summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Alvares Gomes <lucasagomes@gmail.com>2017-01-03 10:12:12 +0000
committerLucas Alvares Gomes <lucasagomes@gmail.com>2017-01-03 12:14:04 +0000
commit2092d5783607223c7cbdfed690997e9c9f831b6f (patch)
treecc27e722e4faf49d59c2954ef2bbb90717dacabd
parentdfd53e55512cba6a8b7e69ac5bf7bea172dfe6b1 (diff)
Auth token, set the correct charset
Explicit set the charset to UTF-8 when replying with 401. It's now required by webob. A previous attempt to fix this problem was introduced as part of the commit 20fb1dbe5a884ecdbf6ee5ea26b2660f7a7e4b1e but this is only compatible with the version 1.7.0 of WebOb, older versions will break. See: http://logs.openstack.org/05/371605/12/check/gate-ironic-python35-db/686bd86/console.html#_2017-01-03_11_10_11_760197 Change-Id: I30adc87882ce8bd2c18588161d5c60d77a56925e Closes-Bug: #1653646
Notes
Notes (review): Code-Review+1: Galyna Zholtkevych <gzholtkevych@mirantis.com> Code-Review+2: Steve Martinelli <s.martinelli@gmail.com> Workflow+1: Steve Martinelli <s.martinelli@gmail.com> Code-Review+2: Samuel de Medeiros Queiroz <samueldmq@gmail.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Tue, 03 Jan 2017 15:01:44 +0000 Reviewed-on: https://review.openstack.org/416198 Project: openstack/keystonemiddleware Branch: refs/heads/master
-rw-r--r--keystonemiddleware/auth_token/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/keystonemiddleware/auth_token/__init__.py b/keystonemiddleware/auth_token/__init__.py
index 5ac66dc..c2d886e 100644
--- a/keystonemiddleware/auth_token/__init__.py
+++ b/keystonemiddleware/auth_token/__init__.py
@@ -651,7 +651,8 @@ class AuthProtocol(BaseAuthProtocol):
651 raise webob.exc.HTTPUnauthorized( 651 raise webob.exc.HTTPUnauthorized(
652 body=jsonutils.dumps(body), 652 body=jsonutils.dumps(body),
653 headers=self._reject_auth_headers, 653 headers=self._reject_auth_headers,
654 content_type='application/json; charset=UTF-8') 654 charset='UTF-8',
655 content_type='application/json')
655 656
656 if request.user_token_valid: 657 if request.user_token_valid:
657 request.set_user_headers(request.token_auth.user) 658 request.set_user_headers(request.token_auth.user)