when https 443 port no need

This commit is contained in:
xiaomlove
2021-02-28 03:33:33 +08:00
parent fe2d522983
commit 268be895e9
+1 -1
View File
@@ -400,7 +400,7 @@ function getSchemeAndHttpHost()
$protocol = $isHttps ? 'https' : 'http'; $protocol = $isHttps ? 'https' : 'http';
$port = $_SERVER['SERVER_PORT']; $port = $_SERVER['SERVER_PORT'];
$result = "$protocol://" . $_SERVER['HTTP_HOST']; $result = "$protocol://" . $_SERVER['HTTP_HOST'];
if ($port != 80) { if ((!$isHttps && $port != 80) || ($isHttps && $port != 443)) {
$result .= ":$port"; $result .= ":$port";
} }
return $result; return $result;