Opened 7 years ago

Closed 4 years ago

#11340 closed Bug (fixed)

HttpResponseNotModified should not return Content-Type header

Reported by: aparajita Owned by: nobody
Component: HTTP handling Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently the HttpResponseNotModified class always returns a Content-Type header of text/html. Safari 4 complains about this. The http spec does not say that a 304 response should not have a Content-Type header, but on the other hand it expressly forbids a content body, so a Content-Type header does seem superfluous.

In any case, this can be fixed (and Safari stops complaining) with a simple change to the HttpResponseModified class. A patch is attached.

Attachments (1)

patch.diff (456 bytes) - added by aparajita 7 years ago.

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by aparajita

Attachment: patch.diff added

comment:1 Changed 7 years ago by Alex Gaynor

Triage Stage: UnreviewedAccepted

comment:2 Changed 6 years ago by Chris Lamb

You would also need to change django.http.utils fix_IE_for_vary to not assume a content-type for this patch to work.

comment:3 Changed 6 years ago by Julien Phalip

Needs tests: set
Severity: Normal
Type: Bug

comment:4 Changed 5 years ago by Aymeric Augustin

UI/UX: unset

Change UI/UX from NULL to False.

comment:5 Changed 5 years ago by Aymeric Augustin

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:6 Changed 4 years ago by Claude Paroz <claude@…>

Resolution: fixed
Status: newclosed

In [7cfe8e8fce7677ec696f42a7d1501a97e8191a3d]:

Fixed #11340 -- Prevented HttpResponseNotModified to have content/content-type

The HTTP 1.1 spec tells that the 304 response MUST NOT contain a
message body.
Thanks aparajita for the report.

Note: See TracTickets for help on using tickets.
Back to Top