aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Enderlin <ivan.enderlin@hoa-project.net>2014-07-29 10:22:59 +0200
committerIvan Enderlin <ivan.enderlin@hoa-project.net>2014-07-29 10:22:59 +0200
commit1c626f079689ad80eaad885e7142f499a2b772e2 (patch)
treec419e69f47b49a69e8b43b60fc5854873dbd9a93
parentc4219fe225f01e0b0e5ad3dbf81ec91ac8a0ee3b (diff)
downloadRouter-1c626f079689ad80eaad885e7142f499a2b772e2.zip
Router-1c626f079689ad80eaad885e7142f499a2b772e2.tar.gz
Router-1c626f079689ad80eaad885e7142f499a2b772e2.tar.bz2
Fix getDomain().
-rw-r--r--Http.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/Http.php b/Http.php
index 210b7b2..2c9baf2 100644
--- a/Http.php
+++ b/Http.php
@@ -730,7 +730,10 @@ class Http extends Generic implements \Hoa\Core\Parameter\Parameterizable {
if('cli' === php_sapi_name())
return $domain = '';
- $domain = $_SERVER['HTTP_HOST'];
+ $domain = $_SERVER['SERVER_NAME'];
+
+ if(empty($domain))
+ $domain = $_SERVER['SERVER_ADDR'];
if(0 !== preg_match('#^(.+):' . static::getPort() . '$#', $domain, $m))
$domain = $m[1];