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

All API endpoints return 400 BadRequest w/ Werkzeug 2.1 #1504

Closed
jantonacci opened this issue Mar 30, 2022 · 1 comment
Closed

All API endpoints return 400 BadRequest w/ Werkzeug 2.1 #1504

jantonacci opened this issue Mar 30, 2022 · 1 comment

Comments

@jantonacci
Copy link

Description

Changes in Werkzeug release 2.1 https://werkzeug.palletsprojects.com/en/2.1.x/changes/#version-2-1-0 include...

Request.get_json() will raise a 400 BadRequest error if the Content-Type header is not application/json. This makes a very common source of confusion more visible. #2339

Expected behaviour

HTTP status code 200 and 'application/json' response

Actual behaviour

HTTP status code 400 with error message...

Did not attempt to load JSON data because the request Content-Type was not 'application/json'

Steps to reproduce

pip install --upgrade Werkzeug==2.1.*

Additional info:

Output of the commands:

  • Python 3.9.5
  • Version: 2.13.0"
@RobbeSneyders
Copy link
Member

Hi @jantonacci could you provide a minimal reproducable example?

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

No branches or pull requests

2 participants