mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #32002 -- Added headers parameter to HttpResponse and subclasses.
This commit is contained in:
committed by
Mariusz Felisiak
parent
2e7cc95499
commit
dcb69043d0
@@ -117,9 +117,10 @@ And the view::
|
||||
|
||||
def head(self, *args, **kwargs):
|
||||
last_book = self.get_queryset().latest('publication_date')
|
||||
response = HttpResponse()
|
||||
# RFC 1123 date format
|
||||
response.headers['Last-Modified'] = last_book.publication_date.strftime('%a, %d %b %Y %H:%M:%S GMT')
|
||||
response = HttpResponse(
|
||||
# RFC 1123 date format.
|
||||
headers={'Last-Modified': last_book.publication_date.strftime('%a, %d %b %Y %H:%M:%S GMT')},
|
||||
)
|
||||
return response
|
||||
|
||||
If the view is accessed from a ``GET`` request, an object list is returned in
|
||||
|
||||
Reference in New Issue
Block a user