php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71276 Built-in webserver does not send Date header
Submitted: 2016-01-04 17:04 UTC Modified: 2016-06-02 11:19 UTC
Votes:5
Avg. Score:3.0 ± 1.1
Reproduced:4 of 4 (100.0%)
Same Version:4 (100.0%)
Same OS:1 (25.0%)
From: me at derrabus dot de Assigned: ab (profile)
Status: Closed Package: Built-in web server
PHP Version: 7.0.1 OS: OS X
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: me at derrabus dot de
New email:
PHP Version: OS:

 

 [2016-01-04 17:04 UTC] 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 -->

Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-06-02 11:19 UTC] ab@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: ab
 [2016-06-02 11:19 UTC] ab@php.net
PR merged.

Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 02:01:28 2024 UTC