Skip to content

Commit a1bf717

Browse files
committed
Normalize by stripping forwaed slash in path
1 parent 3a616b0 commit a1bf717

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

interfaces/UriString.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ public static function parseNormalized(Stringable|string $uri): array
320320
}
321321

322322
$path = Encoder::normalizePath($path);
323-
if (null !== self::buildAuthority($components) && ('' === $path)) {
324-
$path = '/';
323+
if (null !== self::buildAuthority($components) && ('/' === $path)) {
324+
$path = '';
325325
}
326326

327327
$components['path'] = (string) $path;

interfaces/UriStringTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ public static function normalizedUriProvider(): iterable
10631063

10641064
yield 'URI query is partially decoded without affecting delimiter characters' => [
10651065
'uri' => 'https://example.com?foo=bar%26baz%3Dqux',
1066-
'expected' => 'https://example.com/?foo=bar%26baz%3Dqux',
1066+
'expected' => 'https://example.com?foo=bar%26baz%3Dqux',
10671067
];
10681068

10691069
yield 'URI IPv6 host is not compressed' => [

0 commit comments

Comments
 (0)