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

Handle change to Werkzeug 2.1.0 change to Request.get_json(). #423

Commits on Apr 1, 2022

  1. Handle Werkzeug 2.1.0 change to Request.get_json().

    pallets/werkzeug#2339 changed the behavior of `Request.get_json()`
    and the `Request.json` property to raise a `BadRequest` if `Request.get_json()`
    is called without `silent=True`, or the `Request.json` property is accessed,
    and the content type is not `"application/json"`.
    
    Argument parsing allows parsing from multiple locations, and defaults to
    `["json", "values"]`, but if the locations include `"json"` and the content
    type is not `"application/json"`, a `BadRequest` is now raised with Werkzeug >= 2.1.0.
    
    Invoking `Request.get_json()` with the `silent=True` parameter now handles
    the situation where `"json"` is included in the locations, but the content type
    is not `"application/json"`.
    Stacy W. Smith authored and stacywsmith committed Apr 1, 2022
    Copy the full SHA
    bb72a51 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    57c5beb View commit details
    Browse the repository at this point in the history