File response.headers.patch of Package python-django-rest-interface
Index: django_restapi/model_resource.py
===================================================================
--- django_restapi/model_resource.py (revision 72)
+++ django_restapi/model_resource.py (working copy)
@@ -96,7 +96,7 @@
if not self.authentication.is_authenticated(request):
response = self.responder.error(request, 401)
challenge_headers = self.authentication.challenge_headers()
- response.headers.update(challenge_headers)
+ response._headers.update(challenge_headers)
return response
# Remove queryset cache
@@ -151,7 +151,7 @@
model_entry = self.entry_class(self, new_model)
response = model_entry.read(request)
response.status_code = 201
- response.headers['Location'] = model_entry.get_url()
+ response._headers['Location'] = model_entry.get_url()
return response
# Otherwise return a 400 Bad Request error.
@@ -221,7 +221,7 @@
form.save()
response = self.read(request)
response.status_code = 200
- response.headers['Location'] = self.get_url()
+ response._headers['Location'] = self.get_url()
return response
# Otherwise return a 400 Bad Request error.
Index: django_restapi/resource.py
===================================================================
--- django_restapi/resource.py (revision 72)
+++ django_restapi/resource.py (working copy)
@@ -133,7 +133,7 @@
if not self.authentication.is_authenticated(request):
response = HttpResponse(_('Authorization Required'), mimetype=self.mimetype)
challenge_headers = self.authentication.challenge_headers()
- response.headers.update(challenge_headers)
+ response._headers.update(challenge_headers)
response.status_code = 401
return response
@@ -144,4 +144,4 @@
response.mimetype = self.mimetype
return response
-
\ No newline at end of file
+