bug#874 fixed

\Hyperf\HttpServer\Contract\ResponseInterface::redirect()跳转的URL会自动加上hyperf启动端口
This commit is contained in:
box 2019-11-09 18:04:30 +08:00
parent 8878b9b04d
commit 6ec1a863ae

View File

@ -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 {