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

Decode "Content-Encoding: gzip" content

Summary:
Fixes T10228. When we receive a gzipped request (rare, but `git` may send them), decode it before providing it to the application.

This fixes the issue with proxying certain requests described in T10228.

Test Plan:
- Applied this fix in production.
- Cloned a problem repository cleanly.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10228

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

+13 -1
+13 -1
support/PhabricatorStartup.php
··· 129 129 130 130 self::beginOutputCapture(); 131 131 132 - self::$rawInput = (string)file_get_contents('php://input'); 132 + if (isset($_SERVER['HTTP_CONTENT_ENCODING'])) { 133 + $encoding = trim($_SERVER['HTTP_CONTENT_ENCODING']); 134 + } else { 135 + $encoding = null; 136 + } 137 + 138 + if ($encoding === 'gzip') { 139 + $source_stream = 'compress.zlib://php://input'; 140 + } else { 141 + $source_stream = 'php://input'; 142 + } 143 + 144 + self::$rawInput = (string)file_get_contents($source_stream); 133 145 } 134 146 135 147