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

400 error on bad json content type #2355

Merged
merged 1 commit into from Mar 17, 2022
Merged

400 error on bad json content type #2355

merged 1 commit into from Mar 17, 2022

Conversation

davidism
Copy link
Member

@davidism davidism commented Mar 17, 2022

on_json_loading_failed is now called when the content type isn't application/json (and silent isn't true), passing None instead of an exception. This makes a very common source of confusion (most JavaScript clients don't have special behavior for submitting JSON) visible to the developer.

fixes #2339

@davidism davidism added this to the 2.1.0 milestone Mar 17, 2022
@davidism davidism merged commit 6f7e1e5 into main Mar 17, 2022
@davidism davidism deleted the json-content-type branch March 17, 2022 17:02
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

have request.get_json() return an error message
1 participant