Skip to content
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

HTTP Header parsing is inconsistent #170

Open
josch1710 opened this issue Mar 26, 2015 · 1 comment
Open

HTTP Header parsing is inconsistent #170

josch1710 opened this issue Mar 26, 2015 · 1 comment

Comments

@josch1710
Copy link
Contributor

The parsing of a HTTP response headers diverges between Response::_parseHeaders and Response\Headers::fromString.
fromString just parses the header lines and overwrites multiple header line with the same header names, whereas _parseHeaders references RFC2616 Sec 4.2 and concatenates multiple headers to a comma-separated list.
A possible solution would be to move the code of _parseHeaders to fromString and let _parseHeaders call fromString.

@aaronpk
Copy link

aaronpk commented Dec 6, 2015

Ironically, my main reason for starting to use an http client library instead of raw curl commands was to get consistent header parsing, so I was kind of surprised to encounter this issue that it overwrites multiple headers with the same name. +1 to this PR.

nategood pushed a commit that referenced this issue Jul 22, 2016
Solves issue #170: HTTP Header parsing is inconsistent
voku added a commit to voku/httpful that referenced this issue Apr 29, 2019
* upstream/master:
  Add PHPDocs for __call methods.
  nategood#227 unset curl handle after it has been closed
  Fix download link
  Typo correction
  Removed remaining strtolower
  Don't lowercase header names
  Update HttpfulTest.php
  ConnectionErrorException cURLError
  Fix for frameworks that use object proxies
  added support for http_proxy environment variable
  Corrected namespace
  Always lowercase header names.
  Update the tests
  Update Response.php
  Solves issue nategood#170: HTTP Header parsing is inconsistent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants