Skip to content

Commit

Permalink
Merge pull request #26 from bearsunday/soothe_sa
Browse files Browse the repository at this point in the history
Soothe SA
  • Loading branch information
koriym authored Oct 18, 2022
2 parents 415b43c + 335bb00 commit 954fa50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/Provide/Router/RouterContainerProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ class RouterContainerProvider implements ProviderInterface
/**
* @Inject
* @Named("routerFile=aura_router_file")
* @psalm-suppress UnusedVariable
*/
#[Inject, Named('routerFile=aura_router_file')]
public function setRouterContainer(AbstractAppMeta $appMeta, string $routerFile = ''): void
{
$this->routerContainer = new RouterContainer();
$routerFile = $routerFile === '' ? $appMeta->appDir . '/var/conf/aura.route.php' : $routerFile;
// $map is required in $routerFile
$map = $this->routerContainer->getMap();
if (! file_exists($routerFile)) {
throw new InvalidRouterFilePathException($routerFile);
Expand Down
5 changes: 3 additions & 2 deletions src/Provide/Router/WebServerRequestHeaderProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

use function function_exists;
use function getallheaders;
use function is_scalar;
use function str_replace;
use function strtolower;
use function substr;
Expand All @@ -31,8 +32,8 @@ private function getAllHeaders(): array
{
$headers = [];
foreach ($_SERVER as $name => $value) {
if (substr($name, 0, 5) === 'HTTP_') {
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
if (substr($name, 0, 5) === 'HTTP_' && is_scalar($value)) {
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = (string) $value;
}
}

Expand Down

0 comments on commit 954fa50

Please sign in to comment.