1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 08:12:40 +01:00

Fix setup check for gzip request mangling being sent as GET

Summary:
Certain web servers (or cache layers such as Varnish) strip the body
of GET requests, resulting in the setup check failing when it would
otherwise function normally if a request is sent as POST.

Test Plan:
Phorge will no-longer mark the test as failing due to the body of a GET request being dropped.
As per RFC7231, certain implementations of HTTP/1.1 may reject the request or drop the payload
due to a previous revision of the spec where the body was supposed to be ignored (RFC2616, section 4.3)

Reviewers: O1 Blessed Committers, 20after4, speck, avivey

Reviewed By: O1 Blessed Committers, 20after4, speck, avivey

Subscribers: speck, 20after4, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25566
This commit is contained in:
Katie 2024-04-01 20:39:23 +03:00
parent ba835fe0ec
commit d4af32c1d4

View file

@ -58,6 +58,7 @@ final class PhabricatorWebServerSetupCheck extends PhabricatorSetupCheck {
$gzip_future = id(new HTTPSFuture($base_uri))
->addHeader('X-Setup-SelfCheck', 1)
->addHeader('Content-Encoding', 'gzip')
->setMethod('POST')
->setTimeout(5)
->setData($gzip_compressed);