Ensure Location header is strictly a 'str', not subclass. Closes #5541 (#5544)

This commit is contained in:
Tom Christie 2017-10-30 13:08:52 +00:00 committed by GitHub
parent 5009aeff18
commit 2b6245db53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,7 +27,7 @@ class CreateModelMixin(object):
def get_success_headers(self, data):
try:
return {'Location': data[api_settings.URL_FIELD_NAME]}
return {'Location': str(data[api_settings.URL_FIELD_NAME])}
except (TypeError, KeyError):
return {}