Bug #64878 [NEW]: 304 responses return Content-Type header
| From: | jdesrosi at gmail dot com | Date: | Sun, 19 May 2013 19:58:35 +0000 |
| Subject: | Bug #64878 [NEW]: 304 responses return Content-Type header | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-179011@lists.php.net to get a copy of this message | ||
From: jdesrosi at gmail dot com
Operating system: Fedora 18
PHP version: 5.4.15
Package: Built-in web server
Bug Type: Bug
Bug description:304 responses return Content-Type header
Description:
------------
I have discovered that the built-in php web server sends a default
Content-Type
header (text/html) when responding with HTTP/1.1 304 Not Modified. This
clobbers
the Content-Type stored in a cache and violates RFC2616-10.3.5
(http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5)
"If the conditional GET used a strong cache validator (see section 13.3.3),
the
response SHOULD NOT include other entity-headers. Otherwise (i.e., the
conditional GET used a weak validator), the response MUST NOT include other
entity-headers; this prevents inconsistencies between cached entity-bodies
and
updated headers."
I have found related tickets related the Apache. This ticket differs only
in
that it refers to the built-in web server.
Test script:
---------------
<?php
header('HTTP/1.1 304 Not Modified');
Expected result:
----------------
HTTP/1.1 304 Not Modified
Host: localhost:8001
Connection: close
X-Powered-By: PHP/5.4.14
Actual result:
--------------
HTTP/1.1 304 Not Modified
Host: localhost:8001
Connection: close
X-Powered-By: PHP/5.4.14
Content-type: text/html
--
Edit bug report at https://bugs.php.net/bug.php?id=64878&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64878&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64878&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64878&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=64878&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=64878&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64878&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=64878&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=64878&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=64878&r=support
Expected behavior: https://bugs.php.net/fix.php?id=64878&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=64878&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=64878&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=64878&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64878&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=64878&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=64878&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=64878&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64878&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64878&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=64878&r=mysqlcfg