Opened 15 years ago

Closed 12 years ago

#11340 closed Bug (fixed)

HttpResponseNotModified should not return Content-Type header

Reported by: aparajita Owned by: nobody
Component: HTTP handling Version: dev
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 15 years ago.

Download all attachments as: .zip

Change History (7)

by aparajita, 15 years ago

Attachment: patch.diff added

comment:1 by Alex Gaynor, 15 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Chris Lamb, 14 years ago

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 by Julien Phalip, 14 years ago

Needs tests: set
Severity: Normal
Type: Bug

comment:4 by Aymeric Augustin, 13 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:5 by Aymeric Augustin, 13 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:6 by Claude Paroz <claude@…>, 12 years ago

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