Skip to content

Commit f8a74a4

Browse files
[HttpClient] Fix catching some invalid Location headers
1 parent bc7bed0 commit f8a74a4

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

Test/Fixtures/web/index.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
$json = json_encode($vars, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE);
3333

34-
switch ($vars['REQUEST_URI']) {
34+
switch (parse_url($vars['REQUEST_URI'], \PHP_URL_PATH)) {
3535
default:
3636
exit;
3737

@@ -94,13 +94,8 @@
9494

9595
case '/302':
9696
if (!isset($vars['HTTP_AUTHORIZATION'])) {
97-
header('Location: http://localhost:8057/', true, 302);
98-
}
99-
break;
100-
101-
case '/302-no-scheme':
102-
if (!isset($vars['HTTP_AUTHORIZATION'])) {
103-
header('Location: localhost:8067', true, 302);
97+
$location = $_GET['location'] ?? 'http://localhost:8057/';
98+
header('Location: '.$location, true, 302);
10499
}
105100
break;
106101

0 commit comments

Comments
 (0)