Merge "Encode Location header in utf-8"
This commit is contained in:
commit
aa6449ce5d
@ -634,7 +634,10 @@ class StackSerializer(serializers.JSONResponseSerializer):
|
|||||||
|
|
||||||
def _populate_response_header(self, response, location, status):
|
def _populate_response_header(self, response, location, status):
|
||||||
response.status = 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'
|
response.headers['Content-Type'] = 'application/json'
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user