Exemplo n.º 1
0
 public function guessRequestCanonicalUri()
 {
     $server = $this->ns(INPUT_SERVER);
     // Determine if the request was over SSL (HTTPS).
     if (strtolower($server->getValue('HTTPS', 'off')) != 'off') {
         $schema = 'https://';
         $defaultPort = 443;
     } else {
         $schema = 'http://';
         $defaultPort = 80;
     }
     $port = $server->getValue('SERVER_PORT', $defaultPort, ContextNameSpace::NON_NEGATIVE_INT());
     $http_host = $server->getValue('HTTP_HOST', 'localhost');
     $authority = $port === $defaultPort ? $http_host : $http_host . ':' . $port;
     return $schema . $authority . $this->guessRequestRelativeUri();
 }