Skip to content

Navigation Menu

Sign in
Appearance settings

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 66095a5

Browse filesBrowse files
Fix populating server params from URI in HttpFoundationFactory
1 parent cffb3a8 commit 66095a5
Copy full SHA for 66095a5

File tree

2 files changed

+7
-3
lines changed
Filter options

2 files changed

+7
-3
lines changed

‎Factory/HttpFoundationFactory.php

Copy file name to clipboardExpand all lines: Factory/HttpFoundationFactory.php
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,18 @@ public function createRequest(ServerRequestInterface $psrRequest, bool $streamed
5353
$server['REQUEST_URI'] = $uri->getPath();
5454
$server['QUERY_STRING'] = $uri->getQuery();
5555

56+
if ('' !== $server['QUERY_STRING']) {
57+
$server['REQUEST_URI'] .= '?'.$server['QUERY_STRING'];
58+
}
59+
5660
if ('https' === $uri->getScheme()) {
5761
$server['HTTPS'] = 'on';
5862
}
5963
}
6064

6165
$server['REQUEST_METHOD'] = $psrRequest->getMethod();
6266

63-
$server = array_replace($server, $psrRequest->getServerParams());
67+
$server = array_replace($psrRequest->getServerParams(), $server);
6468

6569
$parsedBody = $psrRequest->getParsedBody();
6670
$parsedBody = \is_array($parsedBody) ? $parsedBody : [];

‎Tests/Functional/CovertTest.php

Copy file name to clipboardExpand all lines: Tests/Functional/CovertTest.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ public function requestProvider()
133133
'SERVER_NAME' => 'dunglas.fr',
134134
'SERVER_PORT' => null,
135135
'HTTP_X_SYMFONY' => '2.8',
136-
'REQUEST_URI' => '/testCreateRequest?bar[baz]=42&foo=1',
137-
'QUERY_STRING' => 'foo=1&bar[baz]=42',
136+
'REQUEST_URI' => '/testCreateRequest?foo=1&bar%5Bbaz%5D=42',
137+
'QUERY_STRING' => 'foo=1&bar%5Bbaz%5D=42',
138138
],
139139
'Content'
140140
);

0 commit comments

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