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

Add Content-Type header validation middleware #893

Draft
wants to merge 3 commits into
base: 2.x
Choose a base branch
from

Conversation

prplecake
Copy link

  • If Content-Type is not set to 'application/json' for API POST requests, return a 415 Unsupported Media Type.

Replaces #887
Fixes #885

Something seems to have changed with the request behavior, I'm not sure if that's a due to an updated dependency, but Content-Length is no longer null for $request, and since most tools automatically calculate it, maybe we don't need to explicitly validate for it.

@prplecake prplecake marked this pull request as draft February 5, 2025 20:13
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.

Vague error message for 422 Unprocessable Content
1 participant