httpful icon indicating copy to clipboard operation
httpful copied to clipboard

HTTP Header parsing is inconsistent

Open josch1710 opened this issue 9 years ago • 1 comments

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.

josch1710 avatar Mar 26 '15 17:03 josch1710

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.

aaronpk avatar Dec 06 '15 21:12 aaronpk