Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Http Client with Curl Adapter combined with malformed return headers results in 'Error parsing body' - Exception #6689

Closed
kasitmp opened this issue Sep 23, 2014 · 0 comments

Comments

@kasitmp
Copy link

kasitmp commented Sep 23, 2014

I saw this issue on some major webpages.

In Zend\Http\Client\Adapter\Curl there is a line where the 'Transfer-Encoding: chunked' is removed so it will not be interpreted from the Zend\Http\Response decodeChunkedBody function, because curl already decodes the chunked body.

Here is the example header from buzzfeed.com:

HTTP/1.1 200 OK
Server: Apache
Content-Type: text/html
X-BuzzFeed: webdr08
Vary: Accept-Encoding
Content-Encoding: gzip
Cache-Control: max-age=3
Date: Tue, 23 Sep 2014 14:42:19 GMT
Transfer-Encoding:  chunked

As you can see there are two whitespaces between 'Transfer-Encoding:' and 'chunked' causing the stripos($this->response, "Transfer-Encoding: chunked\r\n") to become false.

As a result the decodeChunkedBody function gets called and throws an exception.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants