diff --git a/Bridges/HttpKernel.php b/Bridges/HttpKernel.php index 91a1ac8..dd57309 100644 --- a/Bridges/HttpKernel.php +++ b/Bridges/HttpKernel.php @@ -48,7 +48,6 @@ public function bootstrap($appBootstrap, $appenv, $debug) $appBootstrap = $this->normalizeAppBootstrap($appBootstrap); $this->bootstrap = new $appBootstrap($appenv, $debug); - if ($this->bootstrap instanceof BootstrapInterface) { $this->application = $this->bootstrap->getApplication(); } @@ -124,7 +123,6 @@ protected function mapRequest(ReactRequest $reactRequest) $headers = $reactRequest->getHeaders(); $query = $reactRequest->getQuery(); - $cookies = []; $_COOKIE = []; $sessionCookieSet = false; @@ -133,7 +131,6 @@ protected function mapRequest(ReactRequest $reactRequest) $headersCookie = explode(';', isset($headers['Cookie']) ? $headers['Cookie'] : $headers['cookie']); foreach ($headersCookie as $cookie) { list($name, $value) = explode('=', trim($cookie)); - $cookies[$name] = $value; $_COOKIE[$name] = $value; if ($name === session_name()) { @@ -150,23 +147,6 @@ protected function mapRequest(ReactRequest $reactRequest) session_id(Utils::generateSessionId()); } - $_SERVER['PHP_AUTH_USER'] = ''; - $_SERVER['PHP_AUTH_PW'] = ''; - $_SERVER['AUTH_TYPE'] = ''; - - if (isset($headers['Authorization'])) { - $authorizationHeader = $headers['Authorization']; - $authorizationHeaderParts = explode(' ', $authorizationHeader); - $type = $authorizationHeaderParts[0]; - if (($type === 'Basic' || $type === 'Digest') && isset($authorizationHeaderParts[1])) { - $credentials = base64_decode($authorizationHeaderParts[1]); - $credentialsParts = explode(':', $credentials); - $_SERVER['PHP_AUTH_USER'] = isset($credentialsParts[0]) ? $credentialsParts[0] : ''; - $_SERVER['PHP_AUTH_PW'] = isset($credentialsParts[1]) ? $credentialsParts[1] : ''; - $_SERVER['AUTH_TYPE'] = $type; - } - } - $files = $reactRequest->getFiles(); $post = $reactRequest->getPost(); @@ -177,10 +157,10 @@ protected function mapRequest(ReactRequest $reactRequest) $class = '\Symfony\Component\HttpFoundation\Request'; } - $syRequest = new $class($query, $post, $attributes = [], $cookies, $files, $_SERVER, $reactRequest->getBody()); + /** @var SymfonyRequest $syRequest */ + $syRequest = new $class($query, $post, $attributes = [], $_COOKIE, $files, $_SERVER, $reactRequest->getBody()); $syRequest->setMethod($method); - $syRequest->headers->add($headers); return $syRequest; }