Bug #71276 [Opn->Csd]: Built-in webserver does not send Date header

From: Date: Thu, 02 Jun 2016 11:19:20 +0000
Subject: Bug #71276 [Opn->Csd]: Built-in webserver does not send Date header
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-201403@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71276&edit=1 ID: 71276 Updated by: ab@php.net Reported by: me at derrabus dot de Summary: Built-in webserver does not send Date header -Status: Open +Status: Closed Type: Bug Package: Built-in web server Operating System: OS X PHP Version: 7.0.1 -Assigned To: +Assigned To: ab Block user comment: N Private report: N New Comment: PR merged. Thanks. Previous Comments: ------------------------------------------------------------------------ [2016-01-04 17:04:36] me at derrabus dot de 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 this bug report at https://bugs.php.net/bug.php?id=71276&edit=1

« previous php.bugs (#201403) next »