1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 04:20:55 +01:00

Fix an issue with passing HTTP headers through in proxied cluster requests

Summary:
I think this fixes the Mercurial + HTTP cluster issue. PHP adds `HTTP_` but we were not stripping it, so we would convert an `X-Whatever-Zebra` header into an `Http-X-Whatever-Zebra` header.

I don't think this behavior has changed? So maybe it just never worked? Git is more popular than Mercurial and SSH is easier to configure than HTTP, so it's plausible. I'll keep a careful eye on this when it deploys.

Test Plan:
  - Set up local service-based Mercurial repository.
  - Tried to clone, got similar error to cluster.
  - Applied patch, clean clone.

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D15660
This commit is contained in:
epriestley 2016-04-08 09:58:17 -07:00
parent 0900ffe9cb
commit 60e91d3934

View file

@ -756,6 +756,7 @@ final class AphrontRequest extends Phobject {
foreach ($_SERVER as $key => $value) {
if (preg_match('/^HTTP_/', $key)) {
// Unmangle the header as best we can.
$key = substr($key, strlen('HTTP_'));
$key = str_replace('_', ' ', $key);
$key = strtolower($key);
$key = ucwords($key);