@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Strip "Transfer-Encoding" headers from proxied HTTP responses

This is a likely fix for HTTP clones against proxied repositories in the
cluster, although I'm not 100% sure I'm replicating it correctly.

The issue appears to be that we're proxying all the headers, including the
"Transfer-Encoding" header, although the request will already have stripped
any encoding. This might cause us to emit a "chunked" header without a
chunked body.

Auditors: chad

+14
+14
src/aphront/response/AphrontHTTPProxyResponse.php
··· 57 57 58 58 list($status, $body, $headers) = $this->future->resolve(); 59 59 $this->httpCode = $status->getStatusCode(); 60 + 61 + // Strip "Transfer-Encoding" headers. Particularly, the server we proxied 62 + // may have chunked the response, but cURL will already have un-chunked it. 63 + // If we emit the header and unchunked data, the response becomes invalid. 64 + foreach ($headers as $key => $header) { 65 + list($header_head, $header_body) = $header; 66 + $header_head = phutil_utf8_strtolower($header_head); 67 + switch ($header_head) { 68 + case 'transfer-encoding': 69 + unset($headers[$key]); 70 + break; 71 + } 72 + } 73 + 60 74 $this->headers = $headers; 61 75 62 76 return $body;