New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix CLI server date format #3982
Conversation
Fix the date format to be compliant with https://tools.ietf.org/html/rfc7231#section-7.1.1.2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a no-brainer as the CLI webserver is only meant for testing anyway, I take it no tests depends on this output and needs to be adjusted
+1 for following standards and standard recommendations. PHP is already too permissive up on too many places. However something more needs to be fixed here I think. With current implementation I get this: Build: PHP 7.2.18-dev
This is intended and ok? |
Previously, local time was used instead of GMT.
@petk Yes, just noticed this while also fixing using GMT instead of local time. It was the length I forgot to change. |
Just for context: this change is motivated by this tweet - which contains a example of the php-cli server misbehaving in comparison to nginx |
I'm in bed so can't review in its entirety, but the other day I noticed a
bug report about static content responder crashing because it uses date
functions that aren't initialized in static response ... Is this in any way
going to effect that?
Cheers
Joe
…On Sun, 24 Mar 2019, 21:46 Markus Staab, ***@***.***> wrote:
Just for context: this change is motivated by this tweet - which contains
a example of the php-cli server misbehaving in comparison to nginx
https://twitter.com/arneblankerts/status/1109857090946957319
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3982 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACIe6mlXjlNZijsx1tQZDZ3FDeD3mF8Lks5vZ-QmgaJpZM4cFrLK>
.
|
Additionally, it would be really good to have a bugs.php.net ID for this if this is going in the PHP-7.2 so we can properly mark it in the NEWS files. Technically, this should go to PHP-7.4+ but if this is not affecting BC then ok. |
So append_essential_headers is invoked by the static responder, can you test this with only static content or static content first, I'm quite sure it's going to fault still ... obviously this was an existing problem, but if you're familiar with this, maybe you could have a look at solving that problem ? (it doesn't/shouldn't block this pr) |
@petk The builtin webserver is not intended for anything but testing & development and I would categorize it as a bug fix, so it should go into the lowest possible branch (probably 7.2 as noted). I agree it should have a ticket associated for NEWS |
Created https://bugs.php.net/bug.php?id=77794 for reference and fixed what has been mentioned. @krakjoe I'm not familiar with the code, just saw the tweet and searched for where the date is formatted, sorry. |
@petk This is a bugfix, so it should go into PHP 7.2 (lowest supported version). Without this fix, the implementation violates the RFC and that causes issues in browsers (see https://gist.github.com/theseer/dff2d65ac80df66afc0a4cca68f4030c). |
Fix the date format to be compliant with https://tools.ietf.org/html/rfc7231#section-7.1.1.2