Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow content type middleware #2576

Closed
wants to merge 4 commits into from
Closed

Allow content type middleware #2576

wants to merge 4 commits into from

Conversation

grqphical
Copy link

See #2551
I used the example code posted by @pzolo85 and made some modifications, mainly the Accept header feature.

This middleware will check if the Content-Type of an incoming request matches a list of allowed values.
In addition, it will modify the Accept field of the response's header with the allowed content types.

Could be useful in telling API client's how the request should be sent and preventing invalid data formats from being sent to the server.

@grqphical grqphical closed this Feb 5, 2024
@grqphical grqphical deleted the allow-content-type-middleware branch February 5, 2024 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant