From 0f92b4806d68aebe2fa8e859a36e539fc7803763 Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Fri, 06 Feb 2026 17:58:04 +0000 Subject: [PATCH] Further simplify code related to header forwarding in AphrontRequest Summary: Followup to D25743 Test Plan: Read the code. Reviewers: O1 Blessed Committers, valerio.bozzolan Reviewed By: O1 Blessed Committers, valerio.bozzolan Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Differential Revision: https://we.phorge.it/D26726 --- src/aphront/AphrontRequest.php | 9 +-------- 1 file(s) changed, 1 insertion(s)(+), 8 deletion(s)(-) diff --git a/src/aphront/AphrontRequest.php b/src/aphront/AphrontRequest.php --- a/src/aphront/AphrontRequest.php +++ b/src/aphront/AphrontRequest.php @@ -909,15 +909,8 @@ $key = ucwords($key); $key = str_replace(' ', '-', $key); - // By default, do not forward headers. - $should_forward = false; - - // Forward "X-Hgarg-..." headers. + // Only forward "X-Hgarg-..." headers. if (preg_match('/^X-Hgarg-/', $key)) { - $should_forward = true; - } - - if ($should_forward) { $headers[] = array($key, $value); } } -- tangled.sh