benoitc / hackney

simple HTTP client in Erlang
Other
1.34k stars 427 forks source link

Leading newlines are not ignored in responses #603

Closed Kuroneer closed 4 years ago

Kuroneer commented 4 years ago

Responses like <<"\r\nHTTP/1.1 200 OK\r\n\r\n">> Are not stripped of the leading newlines, so it fails to parse them.

Kuroneer commented 4 years ago

Also, the trailing CRLF of the chunked responses must be parsed successfully in order to avoid having leading \r\n or only \n in front of the next responses in the connection (in case it is a persistent connection)

Kuroneer commented 4 years ago

I have split the PR related with this ticket (#604) in two: #608 and #609.