Skip to content

Commit 2b6245d

Browse files
Ensure Location header is strictly a 'str', not subclass. Closes #5541 (#5544)
1 parent 5009aef commit 2b6245d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rest_framework/mixins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def perform_create(self, serializer):
2727

2828
def get_success_headers(self, data):
2929
try:
30-
return {'Location': data[api_settings.URL_FIELD_NAME]}
30+
return {'Location': str(data[api_settings.URL_FIELD_NAME])}
3131
except (TypeError, KeyError):
3232
return {}
3333

0 commit comments

Comments
 (0)