-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
Remove guzzle parser #26
Conversation
list($header, $value) = array_map('trim', explode(':', $line, 2)); | ||
|
||
if (!isset($headers[$header])) { | ||
$headers[$header] = $value; |
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.
IMO I think it would be better if $value
was always an array. This would prevent the consumer from having to type check.
A good start! Off the top of my head this is also a valid multi value header:
|
hmm, values may contain comma for a different reasons:
|
Aren't header values seperated by |
github response :)
|
👍 Also we would very highly appreciate unit tests. |
|
||
list($protocol, $version) = explode('/', $http, 2); | ||
|
||
if ($protocol !== 'HTTP' or $version !== '1.0') { |
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.
Not sure about the pinning down on 1.0. Using it to talk to 1.1 servers a lot and that works fine. Not sure what their responses are but blocking 1.1 responses while they used to work in previous 0.4.x versions could be a BC break. Will investigate for you :).
I'm closing this issue in favor of #34. You've done a great job but after @cboden reactphp/http#29 I've realized that using an external package that is specialized in message parsing is the better way to go. Your work is much appreciated and this decision isn't because of the work you've put into it. Once again thank you 👍 |
Simple response parser