Encode Location header in utf-8
We get Location header in unicode format. Need to encode it to utf-8 format, otherwise heat won't work on some requests running via mod_wsgi. Closes-Bug: #1500807 Change-Id: I8950360e71cd62baf899d0aff822b981b5d99068
This commit is contained in:
parent
864181e522
commit
a1b3c23ff8
|
@ -618,7 +618,10 @@ class StackSerializer(serializers.JSONResponseSerializer):
|
|||
|
||||
def _populate_response_header(self, response, location, status):
|
||||
response.status = status
|
||||
response.headers['Location'] = location
|
||||
if six.PY2:
|
||||
response.headers['Location'] = location.encode('utf-8')
|
||||
else:
|
||||
response.headers['Location'] = location
|
||||
response.headers['Content-Type'] = 'application/json'
|
||||
return response
|
||||
|
||||
|
|
Loading…
Reference in New Issue