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

fix(integration): fix FlaskIntegration for Werkzeug > 2.1.0 #1939

Merged
merged 2 commits into from Mar 3, 2023

Conversation

michielderoos
Copy link
Contributor

As explained in this bug report, recent versions of werkzeug introduced the behaviour to get_json where it will throw an error when content_type isn't set.

@michielderoos michielderoos changed the title Update get_json function call for werkzeug 2.1.0+ fix(integration): fix FlaskIntegration for Werkzeug > 2.1.0 Mar 2, 2023
@cc-jj
Copy link

cc-jj commented Mar 3, 2023

Fixes: #1936

Copy link
Member

@antonpirker antonpirker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in old Werkzeug doing .get_json() never resulted in an error and now an error will be thrown unless you add .get_json(silent=True) which then makes get_json behave like in the old Werkzeug? Is this correct?

@michielderoos
Copy link
Contributor Author

michielderoos commented Mar 3, 2023

So in old Werkzeug doing .get_json() never resulted in an error and now an error will be thrown unless you add .get_json(silent=True) which then makes get_json behave like in the old Werkzeug? Is this correct?

@antonpirker Yes, exactly correct! And this is backwards compatible with old versions of Werkzeug as well, silent=true isn't new with their breaking change.

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.

None yet

3 participants