Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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"`.
- Loading branch information