Skip to content

Commit f9bd83b

Browse files
committed
Duplicate headers
PHP (7.1.16) was showing `Content-Type` and `Content-Length` with both their original name and preceded by `HTTP`: ``` CONTENT_TYPE HTTP_CONTENT_TYPE CONTENT_LENGTH HTTP_CONTENT_LENGTH ``` This was causing the headers to be added as duplicates in the request_headers array. Removing the 'CONTENT' condition to prevent the duplicate addition.
1 parent b9b4e2b commit f9bd83b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

proxy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
// identify request headers
5858
$request_headers = array( );
5959
foreach ($_SERVER as $key => $value) {
60-
if (strpos($key, 'HTTP_') === 0 || strpos($key, 'CONTENT_') === 0) {
60+
if (strpos($key, 'HTTP_') === 0 ) {
6161
$headername = str_replace('_', ' ', str_replace('HTTP_', '', $key));
6262
$headername = str_replace(' ', '-', ucwords(strtolower($headername)));
6363
if (!in_array($headername, array( 'Host', 'X-Proxy-Url' ))) {

0 commit comments

Comments
 (0)