From 60e91d393421b2a6218d53e622152f21c2927f09 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 8 Apr 2016 09:58:17 -0700 Subject: [PATCH] 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 --- src/aphront/AphrontRequest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/aphront/AphrontRequest.php b/src/aphront/AphrontRequest.php index f8b01eb94c..3a95b0ebda 100644 --- a/src/aphront/AphrontRequest.php +++ b/src/aphront/AphrontRequest.php @@ -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);