mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-05 21:28:15 +08:00
bug#874 fixed
\Hyperf\HttpServer\Contract\ResponseInterface::redirect()跳转的URL会自动加上hyperf启动端口
This commit is contained in:
parent
8878b9b04d
commit
6ec1a863ae
@ -579,11 +579,10 @@ class Request extends \Hyperf\HttpMessage\Base\Request implements ServerRequestI
|
||||
} elseif (isset($server['server_addr'])) {
|
||||
$uri = $uri->withHost($server['server_addr']);
|
||||
} elseif (isset($header['host'])) {
|
||||
$hasPort = true;
|
||||
if (\strpos($header['host'], ':')) {
|
||||
$hasPort = true;
|
||||
[$host, $port] = explode(':', $header['host'], 2);
|
||||
|
||||
if ($port !== '80') {
|
||||
if ($port != $uri->getDefaultPort()) {
|
||||
$uri = $uri->withPort($port);
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user