-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Request protocol version #1698
Request protocol version #1698
Conversation
👎 in current form The 'host' header isn't supported by HTTP/1.0 so you need to make sure you strip it in that scenario. |
I don't understand what problem you are having. The protocol is set via the |
@akrabat The protocol version is hard-coded to 1.1 in the message class (I think). I don't actually think this is the wrong approach. The PSR-7 specification is only for the representation of HTTP/1.1 messages, there are features of it that are incompatible with HTTP/1.0 - so I think it's dangerous pretending to support it. |
Although that said, you can still do |
It's not very hardcoded! https://github.com/slimphp/Slim/blob/3.x/Slim/Http/Message.php#L87-L101 |
@AndrewCarterUK Yes indeed. That's why I thought it needed to be implemented. Also, this comment is from the MessageInterface: The version string MUST contain only the HTTP version number (e.g., "1.1", "1.0"). @akrabat when I delete the lines of code I added in the constructor of Request the test will fail..That means the protocolVersion is never overwritten with the version in the actual request |
Reading this I think @abbert is right - I can't see where the protocol version is extracted from the environment? |
Yeah - I understand the issue now. |
Thanks very much for this @abbert! |
No problem :) |
Property protocolVersion of Request defaults to 1.1. This change makes it change to the actual request protocol version. Is str_replace('HTTP/' sufficient?