public function Request::getHttpHost

Returns the HTTP host being requested.

The port name will be appended to the host if it's non-standard.

@api

Return value

string

1 call to Request::getHttpHost()
Request::getSchemeAndHttpHost in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php
Gets the scheme and HTTP host.

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Request.php, line 767

Class

Request
Request represents an HTTP request.

Namespace

Symfony\Component\HttpFoundation

Code

public function getHttpHost() {
  $scheme = $this
    ->getScheme();
  $port = $this
    ->getPort();
  if ('http' == $scheme && $port == 80 || 'https' == $scheme && $port == 443) {
    return $this
      ->getHost();
  }
  return $this
    ->getHost() . ':' . $port;
}