mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 16:22:43 +01:00
(stable) 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
This commit is contained in:
parent
482da7f5df
commit
71bda66870
1 changed files with 13 additions and 1 deletions
|
@ -129,7 +129,19 @@ final class PhabricatorStartup {
|
||||||
|
|
||||||
self::beginOutputCapture();
|
self::beginOutputCapture();
|
||||||
|
|
||||||
self::$rawInput = (string)file_get_contents('php://input');
|
if (isset($_SERVER['HTTP_CONTENT_ENCODING'])) {
|
||||||
|
$encoding = trim($_SERVER['HTTP_CONTENT_ENCODING']);
|
||||||
|
} else {
|
||||||
|
$encoding = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($encoding === 'gzip') {
|
||||||
|
$source_stream = 'compress.zlib://php://input';
|
||||||
|
} else {
|
||||||
|
$source_stream = 'php://input';
|
||||||
|
}
|
||||||
|
|
||||||
|
self::$rawInput = (string)file_get_contents($source_stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue