1
0
mirror of https://github.com/django/django.git synced 2025-10-25 06:36:07 +00:00

Fixed #31789 -- Added a new headers interface to HttpResponse.

This commit is contained in:
Tom Carrick
2020-07-14 13:32:24 +02:00
committed by Mariusz Felisiak
parent 71ae1ab012
commit bcc2befd0e
47 changed files with 385 additions and 256 deletions

View File

@@ -24,5 +24,5 @@ class XViewMiddleware(MiddlewareMixin):
if request.method == 'HEAD' and (request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS or
(request.user.is_active and request.user.is_staff)):
response = HttpResponse()
response['X-View'] = get_view_name(view_func)
response.headers['X-View'] = get_view_name(view_func)
return response