Skip to content

Commit

Permalink
#322 - adding more calls to Request::getGlobalServerValue()
Browse files Browse the repository at this point in the history
  • Loading branch information
alphadevx committed Dec 9, 2017
1 parent 66099b5 commit a617ec5
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions Alpha/Util/Http/Request.php
Expand Up @@ -225,26 +225,22 @@ public function __construct($overrides = array())
// set HTTP host
if (isset($overrides['host'])) {
$this->host = $overrides['host'];
} elseif (isset($_SERVER['HTTP_HOST'])) {
$this->host = $_SERVER['HTTP_HOST'];
} else {
$this->host = 'localhost';
$this->host = $this->getGlobalServerValue('HTTP_HOST');
}

// set IP of the client
if (isset($overrides['IP'])) {
$this->IP = $overrides['IP'];
} elseif (isset($_SERVER['REMOTE_ADDR'])) {
$this->IP = $_SERVER['REMOTE_ADDR'];
} else {
$this->IP = '127.0.0.1';
$this->IP = $this->getGlobalServerValue('REMOTE_ADDR');
}

// set requested URI
if (isset($overrides['URI'])) {
$this->URI = $overrides['URI'];
} elseif (isset($_SERVER['REQUEST_URI'])) {
$this->URI = $_SERVER['REQUEST_URI'];
} else {
$this->URI = $this->getGlobalServerValue('REQUEST_URI');
}

// set uploaded files (if any)
Expand Down

0 comments on commit a617ec5

Please sign in to comment.