From 2b6245db5359571f10d27ace16473d70e160dce2 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 30 Oct 2017 13:08:52 +0000 Subject: [PATCH] Ensure Location header is strictly a 'str', not subclass. Closes #5541 (#5544) --- rest_framework/mixins.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/mixins.py b/rest_framework/mixins.py index f3695e665..de10d6930 100644 --- a/rest_framework/mixins.py +++ b/rest_framework/mixins.py @@ -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 {}