#3299 [Com]: Unwanted `Content-Type' header

From: Date: Tue, 15 Oct 2002 12:15:25 +0000
Subject: #3299 [Com]: Unwanted `Content-Type' header
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-22489@lists.php.net to get a copy of this message
ID: 3299 Comment by: vesely@tana.it Reported By: teo@digiro.net Status: Closed Bug Type: Scripting Engine problem Operating System: RH6.0 PHP Version: 4.0 Beta 3 New Comment: Yes, rfc say that 1xx, 204 and 304 MUST NOT contain a body, but they don't explicitely say that the content-type header is allowed in such cases. RFC 2616 in section 14.17 says "The Content-Type entity-header field indicates the "media type of the entity-body sent to the recipient "or, in the case of the HEAD method, the media type "that would have been sent had the request been a GET. No mention of a "default content-type" for the body that would have been sent had the response code been different. Hence the following is illegal: HTTP/1.1 204 No Content Date: Tue, 15 Oct 2002 12:03:34 GMT Server: Apache/1.3.19 Connection: close Content-Type: text/html Furthermore, the "Status:" header may be misinterpreted by the httpd server, resulting in output as the one below: HTTP/1.1 200 OK Date: Tue, 15 Oct 2002 12:02:40 GMT Server: Apache/1.3.19 status: 204 No Content Connection: close Content-Type: text/html Please reopen this bug. Regards Ale Vesely Previous Comments: ------------------------------------------------------------------------ [2000-05-30 19:22:24] stas@cvs.php.net RFC 2616 says 204 can contain no body, but may contain headers. PHP is in compliance. ------------------------------------------------------------------------ [2000-01-24 13:13:16] teo@digiro.net <? Header ("HTTP/1.1 204 No Content"); ?> will fail because PHP will automatically append a ``Content-Type: text/html'' which screws up the logics. (no response body is expected for 204 but `content type' announce one) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=3299&edit=1

« previous php.bugs (#22489) next »