Skip to content

400 error on bad json content type#2355

Merged
davidism merged 1 commit intomainfrom
json-content-type
Mar 17, 2022
Merged

400 error on bad json content type#2355
davidism merged 1 commit intomainfrom
json-content-type

Conversation

@davidism
Copy link
Copy Markdown
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