mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-11 07:11:04 +01:00
Disable automatic decoding of "Content-Encoding" responses during "Accept-Encoding" setup test
Summary: Ref T13507. Now that we handle processing of "Content-Encoding: gzip" headers by default, this setup check can get a decompressed body back. Since it specifically wants a raw body back, disable this behavior. Also, "@" a couple things which can get in the way if they fail now that error handling is more aggressive about throwing on warnings. Test Plan: Ran setup check after other changes in T13507, got clean result. Maniphest Tasks: T13507 Differential Revision: https://secure.phabricator.com/D21122
This commit is contained in:
parent
0ea6d131e0
commit
b52fa96238
1 changed files with 3 additions and 2 deletions
|
@ -45,6 +45,7 @@ final class PhabricatorWebServerSetupCheck extends PhabricatorSetupCheck {
|
||||||
$self_future = id(new HTTPSFuture($base_uri))
|
$self_future = id(new HTTPSFuture($base_uri))
|
||||||
->addHeader('X-Phabricator-SelfCheck', 1)
|
->addHeader('X-Phabricator-SelfCheck', 1)
|
||||||
->addHeader('Accept-Encoding', 'gzip')
|
->addHeader('Accept-Encoding', 'gzip')
|
||||||
|
->setDisableContentDecoding(true)
|
||||||
->setHTTPBasicAuthCredentials(
|
->setHTTPBasicAuthCredentials(
|
||||||
$expect_user,
|
$expect_user,
|
||||||
new PhutilOpaqueEnvelope($expect_pass))
|
new PhutilOpaqueEnvelope($expect_pass))
|
||||||
|
@ -134,7 +135,7 @@ final class PhabricatorWebServerSetupCheck extends PhabricatorSetupCheck {
|
||||||
->setMessage($message);
|
->setMessage($message);
|
||||||
} else {
|
} else {
|
||||||
if (function_exists('gzdecode')) {
|
if (function_exists('gzdecode')) {
|
||||||
$body = gzdecode($body);
|
$body = @gzdecode($body);
|
||||||
} else {
|
} else {
|
||||||
$body = null;
|
$body = null;
|
||||||
}
|
}
|
||||||
|
@ -303,7 +304,7 @@ final class PhabricatorWebServerSetupCheck extends PhabricatorSetupCheck {
|
||||||
}
|
}
|
||||||
|
|
||||||
$raw_body = idx($structure, 'raw.base64');
|
$raw_body = idx($structure, 'raw.base64');
|
||||||
$raw_body = base64_decode($raw_body);
|
$raw_body = @base64_decode($raw_body);
|
||||||
|
|
||||||
// The server received the exact compressed bytes we expected it to, so
|
// The server received the exact compressed bytes we expected it to, so
|
||||||
// everything is working great.
|
// everything is working great.
|
||||||
|
|
Loading…
Reference in a new issue