Index: src/aphront/AphrontRequest.php =================================================================== --- src/aphront/AphrontRequest.php +++ src/aphront/AphrontRequest.php @@ -471,9 +471,23 @@ // underscores, then prepending 'HTTP_'. $php_index = strtoupper($name); $php_index = str_replace('-', '_', $php_index); - $php_index = 'HTTP_'.$php_index; - return idx($_SERVER, $php_index, $default); + $try_names = array(); + + $try_names[] = 'HTTP_'.$php_index; + if ($php_index == 'CONTENT_TYPE' || $php_index == 'CONTENT_LENGTH') { + // These headers may be avilable under alternate names. See + // http://www.php.net/manual/en/reserved.variables.server.php#110763 + $try_names[] = $php_index; + } + + foreach ($try_names as $try_name) { + if (array_key_exists($try_name, $_SERVER)) { + return $_SERVER[$try_name]; + } + } + + return $default; } }