Uh oh!
There was an error while loading. Please reload this page.
Require Host on 1.1 requests - #208
Conversation
| } | ||
| if ($request->getProtocolVersion() === '1.1' && !$request->hasHeader('Host')) { | ||
| throw new \InvalidArgumentException('A client must send a host header field in all HTTP/1.1 request messages'); |
There was a problem hiding this comment.
The parameter to parseRequest ($headers) is not a valid argument.
Also, all exceptions in this method are InvalidArgumentExceptions so I was just keeping the format.
clue
commented
Jul 27, 2017
Thanks for filing this PR! 👍 I see where you're coming from and would love to hear some more thoughts on this! I think the (more) relevant quote from the RFC would be this:
A similar patch was filed with #127 which was later reverted partly by #173 and #201 (all by me in fact). This was done both for consistency between HTTP/1.1 and HTTP/1.0 requests and because I've been running this project in production for a few months now and (despite violating RFC 7230) have repeatedly seen HTTP/1.1 requests without a The question actually boils down to: Is a |
clue
commented
Aug 10, 2017
Ping @aaronbonneau, what's the status here? 👍 |
clue
commented
Sep 5, 2017
I'm closing this for now as it hasn't received any input in a while and I believe this has been answered. Please come back with more details if this problem persists and we can reopen this 👍 |
RFC 7230 requires "A client MUST send a Host header field in all HTTP/1.1 request messages."