Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit df735ec

Browse filesBrowse files
bug #78 Fix populating default port and headers in HttpFoundationFactory (mleczakm)
This PR was merged into the 2.0-dev branch. Discussion ---------- Fix populating default port and headers in HttpFoundationFactory These are few dirty hacks which are required to get symfony up and running as Roadrunner psr7 worker: - overriding headers need to be removed to be able to send basic auth headers. - setting `$_SERVER['https']` to true is required for properly handling non-proxied requests, handled with encryption directly from Roadrunner - same as symfony/psr-http-message-bridge#77 - setting default server port fixes error with interpreting no port defined in url as `0` Commits ------- 4f30401 Fix populating default port and headers in HttpFoundationFactory
2 parents 1309b64 + 4f30401 commit df735ec
Copy full SHA for df735ec

File tree

1 file changed

+2
-2
lines changed
Filter options

1 file changed

+2
-2
lines changed

‎Factory/HttpFoundationFactory.php

Copy file name to clipboardExpand all lines: Factory/HttpFoundationFactory.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function createRequest(ServerRequestInterface $psrRequest, bool $streamed
4949

5050
if ($uri instanceof UriInterface) {
5151
$server['SERVER_NAME'] = $uri->getHost();
52-
$server['SERVER_PORT'] = $uri->getPort();
52+
$server['SERVER_PORT'] = $uri->getPort() ?: ('https' === $uri->getScheme() ? 443 : 80);
5353
$server['REQUEST_URI'] = $uri->getPath();
5454
$server['QUERY_STRING'] = $uri->getQuery();
5555

@@ -74,7 +74,7 @@ public function createRequest(ServerRequestInterface $psrRequest, bool $streamed
7474
$server,
7575
$streamed ? $psrRequest->getBody()->detach() : $psrRequest->getBody()->__toString()
7676
);
77-
$request->headers->replace($psrRequest->getHeaders());
77+
$request->headers->add($psrRequest->getHeaders());
7878

7979
return $request;
8080
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.