fix getSchemeAndHttpHost()

This commit is contained in:
xiaomlove
2021-03-05 19:43:40 +08:00
parent bdefe4d30b
commit cb4e5e5eb5
5 changed files with 11 additions and 9 deletions
+4 -3
View File
@@ -403,9 +403,10 @@ function getSchemeAndHttpHost()
$protocol = $isHttps ? 'https' : 'http';
$port = $_SERVER['SERVER_PORT'];
$result = "$protocol://" . $_SERVER['HTTP_HOST'];
if ((!$isHttps && $port != 80) || ($isHttps && $port != 443)) {
$result .= ":$port";
}
//HTTP_HOST include port
// if ((!$isHttps && $port != 80) || ($isHttps && $port != 443)) {
// $result .= ":$port";
// }
return $result;
}