Bug #71276 [NEW]: Built-in webserver does not send Date header

From: Date: Mon, 04 Jan 2016 17:04:38 +0000
Subject: Bug #71276 [NEW]: Built-in webserver does not send Date header
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198411@lists.php.net to get a copy of this message
From: me at derrabus dot de Operating system: OS X PHP version: 7.0.1 Package: Built-in web server Bug Type: Bug Bug description:Built-in webserver does not send Date header Description: ------------ According to RFC 7231, the Date header is mandatory for HTTP responses. It should contain "the best available approximation of the date and time of message generation". https://tools.ietf.org/html/rfc7231#section-7.1.1.2 Usually, it's the webserver's task to add this header. For instance, the header is magically present in responses coming from an Apache webserver with mod_php. PHP's build-in webserver on the other hand does not add that header. Strangely enough, it sends a Host header with the response (copied from the request), although that header is afaik a request-only header. Test script: --------------- php -S localhost:8080 any-script.php Expected result: ---------------- GET / HTTP/1.1 Host: localhost HTTP/1.1 200 OK Date: Mon, 04 Jan 2016 16:36:54 GMT Content-type: text/html; charset=UTF-8 <!-- The actual content --> Actual result: -------------- GET / HTTP/1.1 Host: localhost HTTP/1.1 200 OK Host: localhost Connection: close X-Powered-By: PHP/7.0.1 Content-type: text/html; charset=UTF-8 <!-- The actual content --> -- Edit bug report at https://bugs.php.net/bug.php?id=71276&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71276&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71276&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71276&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=71276&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=71276&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=71276&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=71276&r=needscript Try newer version: https://bugs.php.net/fix.php?id=71276&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=71276&r=support Expected behavior: https://bugs.php.net/fix.php?id=71276&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=71276&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=71276&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=71276&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71276&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=71276&r=dst IIS Stability: https://bugs.php.net/fix.php?id=71276&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=71276&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=71276&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=71276&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=71276&r=mysqlcfg

« previous php.bugs (#198411) next »