#33057 [NEW]: PHP returns Content-Type header for 304 responses
| From: | cboitel at lfdj dot com | Date: | Wed, 18 May 2005 14:12:28 +0000 |
| Subject: | #33057 [NEW]: PHP returns Content-Type header for 304 responses | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-79146@lists.php.net to get a copy of this message | ||
From: cboitel at lfdj dot com
Operating system: Solaris/Linux
PHP version: 4.3.11
PHP Bug Type: Apache related
Bug description: PHP returns Content-Type header for 304 responses
Description:
------------
When setting response code to 304 from within PHP code, a "Content-Type:"
header is always added when PHP is compiled within Apache 1.3x whereas it
is not for Apache 2.x
This makes Apache 1.3x/PHP non compliant with RFC HTTP/1.1 for 304
responses in the case where a weak validator is used (Content-Type MUST
not be returned).
Reproduce code:
---------------
mytest1.php
<?
header( "HTTP/1.1 304 Not Modified" );
?>
Expected result:
----------------
telnet localhost 80
GET /mytest1.php HTTP/1.0
HTTP/1.1 304 Not Modified
Date: Wed, 18 May 2005 14:10:06 GMT
Server: Apache
Connection: close
Actual result:
--------------
telnet localhost 80
GET /mytest1.php HTTP/1.0
HTTP/1.1 304 Not Modified
Date: Wed, 18 May 2005 14:10:06 GMT
Server: Apache
Content-Type: text/html
Connection: close
--
Edit bug report at http://bugs.php.net/?id=33057&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33057&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33057&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33057&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=33057&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=33057&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=33057&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=33057&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=33057&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=33057&r=support
Expected behavior: http://bugs.php.net/fix.php?id=33057&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=33057&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=33057&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=33057&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33057&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=33057&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=33057&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=33057&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=33057&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=33057&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=33057&r=mysqlcfg