Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Ticket #508 (defect)

Opened 3 years ago

Last modified 2 years ago

304s generated via HTTPRedirect() should not set Content-Type

Status: closed (fixed)

Reported by: lukem Assigned to: rdelon
Priority: normal Milestone:
Component: CherryPy code Keywords: 304 httpredirect content-type
Cc:

Since 304s do not (and must not) return a message body, it is inappropriate for them to set the Content-Type header. The current implementation always sets 304 Content-Type to text/html, which is especially bad for for non-html resources.

To fix, just move the cherrypy.response.headerMap['Content-Type'] = "text/html" line into the if status in (300, 301, 302, 303, 307): block in cherrypy/_cperror.py.

Change History

04/13/06 00:45:44: Modified by lukem

Hmm, perhaps a del cherrypy.response.headerMap['Content-Type'] would be more appropriate, as there seems to be a default Content-Type header set by the Request object's constructor.

05/02/06 18:05:11: Modified by fumanchu

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [1089].

12/09/06 12:41:24: Modified by fumanchu

Fixed in 2.x in [1482].

Hosted by WebFaction

Log in as guest/cpguest to create tickets