Opened 6 years ago

Closed 3 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 6 years ago.

Download all attachments as: .zip

Change History (7)

Changed 6 years ago by aparajita

comment:1 Changed 6 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 5 years ago by lamby

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 4 years ago by julien

  • Needs tests set
  • Severity set to Normal
  • Type set to Bug

comment:4 Changed 4 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:5 Changed 4 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

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

  • Resolution set to fixed
  • Status changed from new to closed

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