@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.

When proxying HTTP repository responses from repository nodes, discard content description headers

Summary:
Ref T13517. See that task for details about the underlying issue here.

Currently, we may decode a compressed response, then retransmit it with leftover "Content-Encoding" and "Content-Length" headers. Instead, strip these headers.

Test Plan:
- In a clustered repository setup, cloned a Git repository over HTTP.
- Before: Error while processing content unencoding: invalid stored block lengths
- After: Clean clone.

Maniphest Tasks: T13517

Differential Revision: https://secure.phabricator.com/D21167

+6
+6
src/aphront/response/AphrontHTTPProxyResponse.php
··· 61 61 // Strip "Transfer-Encoding" headers. Particularly, the server we proxied 62 62 // may have chunked the response, but cURL will already have un-chunked it. 63 63 // If we emit the header and unchunked data, the response becomes invalid. 64 + 65 + // See T13517. Strip "Content-Encoding" and "Content-Length" headers, since 66 + // they may reflect compressed content. 67 + 64 68 foreach ($headers as $key => $header) { 65 69 list($header_head, $header_body) = $header; 66 70 $header_head = phutil_utf8_strtolower($header_head); 67 71 switch ($header_head) { 68 72 case 'transfer-encoding': 73 + case 'content-encoding': 74 + case 'content-length': 69 75 unset($headers[$key]); 70 76 break; 71 77 }