@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

When proxying cluster HTTP requests, forward only selected headers

In the live cluster, some subset of the forwarded headers are creating
some issues for HTTP repository operations.

+19 -7
+19 -7
src/aphront/AphrontRequest.php
··· 754 754 // NOTE: apache_request_headers() might provide a nicer way to do this, 755 755 // but isn't available under FCGI until PHP 5.4.0. 756 756 foreach ($_SERVER as $key => $value) { 757 - if (preg_match('/^HTTP_/', $key)) { 758 - // Unmangle the header as best we can. 759 - $key = substr($key, strlen('HTTP_')); 760 - $key = str_replace('_', ' ', $key); 761 - $key = strtolower($key); 762 - $key = ucwords($key); 763 - $key = str_replace(' ', '-', $key); 757 + if (!preg_match('/^HTTP_/', $key)) { 758 + continue; 759 + } 764 760 761 + // Unmangle the header as best we can. 762 + $key = substr($key, strlen('HTTP_')); 763 + $key = str_replace('_', ' ', $key); 764 + $key = strtolower($key); 765 + $key = ucwords($key); 766 + $key = str_replace(' ', '-', $key); 767 + 768 + // By default, do not forward headers. 769 + $should_forward = false; 770 + 771 + // Forward "X-Hgarg-..." headers. 772 + if (preg_match('/^X-Hgarg-/', $key)) { 773 + $should_forward = true; 774 + } 775 + 776 + if ($should_forward) { 765 777 $headers[] = array($key, $value); 766 778 $seen[$key] = true; 767 779 }