We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aba10dc commit 701517dCopy full SHA for 701517d
1 file changed
src/YurunHttp/Traits/THandler.php
@@ -31,13 +31,16 @@ public function parseRedirectLocation($location, $currentUri)
31
}
32
else
33
{
34
- $path = \dirname($currentUri);
35
- if ('\\' === \DIRECTORY_SEPARATOR && false !== strpos($path, \DIRECTORY_SEPARATOR))
+ $uri = $currentUri;
+ $path = $currentUri->getPath();
36
+ if('/' !== substr($path, -1, 1))
37
- $path = str_replace(\DIRECTORY_SEPARATOR, '/', $path);
38
+ $path = $path . '/';
39
- $uri = new Uri($path . '/' . $location);
40
+ $path .= $location;
41
+ $uri = $uri->withPath($path);
42
43
+ $uri = $uri->withHost($currentUri->getHost())->withPort($currentUri->getPort());
44
45
46
0 commit comments