Skip to content

Conversation

@max-len
Copy link
Contributor

@max-len max-len commented Nov 24, 2022

Return HTTP status 415 instead of 400 to indicate a problem with Content-Type more precisely when processing json requests.

amends #2355
fixes #2550

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Add .. versionchanged:: entries in any relevant code docs.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.

pre-commit-ci bot and others added 3 commits November 1, 2022 06:53
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Copy link
Member

@pgjones pgjones left a comment

Choose a reason for hiding this comment

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

This makes sense to me, and I agree would have helped me debug issues a number of times in the past. Will merge later today (unless there is disagreement).

@pgjones pgjones merged commit eef696b into pallets:main Dec 19, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 8, 2023
@davidism
Copy link
Member

davidism commented Jan 9, 2023

This got merged into main, but the changelog entry is for 2.2.3. Either it should have been rebased to 2.2.x, or the entry should have been moved to the 2.3.0 section. Also needed a milestone marker.

@davidism davidism added this to the 2.3.0 milestone Jan 9, 2023
.. versionchanged:: 2.1
Raise a 400 error if the content type is incorrect.
.. versionchanged:: 2.2.3
Copy link
Member

Choose a reason for hiding this comment

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

This changed an existing released changelog entry instead of adding a new one.

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.

json: Return 415 if wrong Content-Type

3 participants