summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2016-12-28 16:52:01 +0100
committerJulien Danjou <julien@danjou.info>2016-12-28 16:52:01 +0100
commit20fb1dbe5a884ecdbf6ee5ea26b2660f7a7e4b1e (patch)
tree2a3fcd1973bbe6012ef50223a2788abaec23d501
parent3e6c3ff6bde8c921704fa9506fb2ba89762f65cd (diff)
auth_token: set correct charset when replying with 401
The Content-Type header does not contain the charset used for the message. It's now required by webob: File "/home/jenkins/workspace/gate-gnocchi-tox-db-py35-mysql-ubuntu-xenial/.tox/py35-mysql/lib/python3.5/site-packages/keystonemiddleware/auth_token/__init__.py", line 331, in __call__ response = self.process_request(req) File "/home/jenkins/workspace/gate-gnocchi-tox-db-py35-mysql-ubuntu-xenial/.tox/py35-mysql/lib/python3.5/site-packages/keystonemiddleware/auth_token/__init__.py", line 650, in process_request content_type='application/json') File "/home/jenkins/workspace/gate-gnocchi-tox-db-py35-mysql-ubuntu-xenial/.tox/py35-mysql/lib/python3.5/site-packages/webob/exc.py", line 268, in __init__' **kw) File "/home/jenkins/workspace/gate-gnocchi-tox-db-py35-mysql-ubuntu-xenial/.tox/py35-mysql/lib/python3.5/site-packages/webob/response.py", line 310, in __init__' "You cannot set the body to a text value without a " TypeError: You cannot set the body to a text value without a charset Change-Id: Ia6c667c9afcba0811f51f3e50f34de05310d1433
Notes
Notes (review): Code-Review+2: Steve Martinelli <s.martinelli@gmail.com> Code-Review+2: Boris Bobrov <bbobrov@mirantis.com> Workflow+1: Boris Bobrov <bbobrov@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Sat, 31 Dec 2016 11:53:30 +0000 Reviewed-on: https://review.openstack.org/415502 Project: openstack/keystonemiddleware Branch: refs/heads/master
-rw-r--r--keystonemiddleware/auth_token/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/keystonemiddleware/auth_token/__init__.py b/keystonemiddleware/auth_token/__init__.py
index cfdc01c..a136a65 100644
--- a/keystonemiddleware/auth_token/__init__.py
+++ b/keystonemiddleware/auth_token/__init__.py
@@ -647,7 +647,7 @@ class AuthProtocol(BaseAuthProtocol):
647 raise webob.exc.HTTPUnauthorized( 647 raise webob.exc.HTTPUnauthorized(
648 body=jsonutils.dumps(body), 648 body=jsonutils.dumps(body),
649 headers=self._reject_auth_headers, 649 headers=self._reject_auth_headers,
650 content_type='application/json') 650 content_type='application/json; charset=UTF-8')
651 651
652 if request.user_token_valid: 652 if request.user_token_valid:
653 request.set_user_headers(request.token_auth.user) 653 request.set_user_headers(request.token_auth.user)