改进HOST的获取

This commit is contained in:
yunwuxin
2017-11-02 14:29:22 +08:00
parent 9db0007e36
commit 7af0a6a22b

View File

@@ -1342,6 +1342,9 @@ class Request
*/
public function host()
{
if (isset($_SERVER['HTTP_X_REAL_HOST'])) {
return $_SERVER['HTTP_X_REAL_HOST'];
}
return $this->server('HTTP_HOST');
}