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

Not removed Transfer-Encoding: chunked #181

@victorpal

Description

@victorpal

When submitting the form with Adapter Curl you have
// cURL automatically decodes chunked-messages, this means we have to
// disallow the Zend\Http\Response to do it again.
$responseHeaders = preg_replace("/Transfer-Encoding:\s*chunked\\r\\n/i", '', $responseHeaders);
which is OK but in line 503
$this->response = substr_replace($this->response, $responseHeaders, 0, $responseHeaderSize);

$this->response (the first parameter of substr) is:

HTTP/1.0 200 Connection established

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Encoding: gzip
Date: Tue, 06 Aug 2019 12:45:19 GMT
Expires: Tue, 06 Aug 2019 12:45:19 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Alt-Svc: quic=":443"; ma=2592000; v="46,43,39"
Connection: close
Transfer-Encoding: chunked

��� ��RPP*.MNN-.V�RHK�)N���������&秤�ģ�B@��������]�LJiANfrbI��P*��� g� �I


$responseHeaders is:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Encoding: gzip
Date: Tue, 06 Aug 2019 12:45:19 GMT
Expires: Tue, 06 Aug 2019 12:45:19 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Alt-Svc: quic=":443"; ma=2592000; v="46,43,39"
Connection


and $responseHeaderSize = curl_getinfo($this->curl, CURLINFO_HEADER_SIZE); is 405

which results in $this->result =

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Encoding: gzip
Date: Tue, 06 Aug 2019 12:45:19 GMT
Expires: Tue, 06 Aug 2019 12:45:19 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Server: GSE
Alt-Svc: quic=":443"; ma=2592000; v="46,43,39"
Connection: close
Transfer-Encoding: chunked

��� ��RPP*.MNN-.V�RHK�)N���������&秤�ģ�B@��������]�LJiANfrbI��P*��� g� �I


so in the header "Transfer-Encoding: chunked" is still there and then i hit an exception:

exception 'Zend\Http\Exception\RuntimeException' with message 'Error parsing body - doesn't seem to be a chunked message' in zendframework/zend-http/src/Response.php:533

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions