diff options
author | morgan fainberg <morgan.fainberg@gmail.com> | 2019-05-01 09:21:07 -0700 |
---|---|---|
committer | Sam Morrison <sorrison@gmail.com> | 2020-03-25 08:56:39 +1100 |
commit | 9b73d7dfe0ce85865b23bc5636a73f9c64cd40e3 (patch) | |
tree | 5ac9307c4241d44d0ab5f9ed9962f6fe8dc4bd87 | |
parent | 2de401b79ba5baf69c7ab8f9c68f02d69f9ae47e (diff) | |
download | keystone-9b73d7dfe0ce85865b23bc5636a73f9c64cd40e3.tar.gz |
Fix for werkzeug > 0.15
Werkzeug is pickier about how Content-Type is handled in general.
In this case we are now explicitly checking for either Content-Type
being '' or being non-existant in addition to Content-Type being set
to json for decoding the body.
Change-Id: Ia5a7750cff833aa90f7fc446f396c270343fc590
(cherry picked from commit 3d31723b3bfdbb43037acf9e916740ba918e48e2)
-rw-r--r-- | keystone/server/flask/request_processing/json_body.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/keystone/server/flask/request_processing/json_body.py b/keystone/server/flask/request_processing/json_body.py index 9fd5f65f7..cce0763d3 100644 --- a/keystone/server/flask/request_processing/json_body.py +++ b/keystone/server/flask/request_processing/json_body.py @@ -38,7 +38,7 @@ def json_body_before_request(): # Explicitly check if the content is supposed to be json. if (flask.request.is_json - or flask.request.headers['Content-Type'] == ''): + or flask.request.headers.get('Content-Type', '') == ''): json_decoded = flask.request.get_json(force=True) if not isinstance(json_decoded, dict): # In the case that the returned value was not a dict, force |