Added 7.4 to travis.yml.
Fixed a bug where not all request headers were available when running under apache server.
This commit is contained in:
parent
645bcf227c
commit
2eaa8c8697
|
|
@ -2,6 +2,7 @@ language: php
|
||||||
php:
|
php:
|
||||||
- "7.2"
|
- "7.2"
|
||||||
- "7.3"
|
- "7.3"
|
||||||
|
- "7.4"
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- composer selfupdate
|
- composer selfupdate
|
||||||
|
|
|
||||||
|
|
@ -479,14 +479,19 @@ class ServerRequest extends Request implements ServerRequestInterface
|
||||||
*/
|
*/
|
||||||
protected function getServerRequestHeaders()
|
protected function getServerRequestHeaders()
|
||||||
{
|
{
|
||||||
// http://www.php.net/manual/en/function.getallheaders.php#84262
|
if (!function_exists('apache_get_version')) {
|
||||||
$headers = array();
|
// http://www.php.net/manual/en/function.getallheaders.php#84262
|
||||||
foreach ($_SERVER as $name => $value) {
|
$headers = array();
|
||||||
if (substr($name, 0, 5) === "HTTP_") {
|
foreach ($_SERVER as $name => $value) {
|
||||||
$headers[str_replace(" ", "-", ucwords(strtolower(str_replace("_", " ", substr($name, 5)))))] = $value;
|
if (substr($name, 0, 5) === "HTTP_") {
|
||||||
|
$headers[str_replace(" ", "-", ucwords(strtolower(str_replace("_", " ", substr($name, 5)))))] = $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return $headers;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return apache_request_headers();
|
||||||
}
|
}
|
||||||
return $headers;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue