You are here

private function Request::updateHostFromUri in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/psr7/src/Request.php \GuzzleHttp\Psr7\Request::updateHostFromUri()
1 call to Request::updateHostFromUri()
Request::__construct in vendor/guzzlehttp/psr7/src/Request.php

File

vendor/guzzlehttp/psr7/src/Request.php, line 138

Class

Request
PSR-7 request implementation.

Namespace

GuzzleHttp\Psr7

Code

private function updateHostFromUri($host) {

  // Ensure Host is the first header.
  // See: http://tools.ietf.org/html/rfc7230#section-5.4
  if ($port = $this->uri
    ->getPort()) {
    $host .= ':' . $port;
  }
  $this->headerLines = [
    'Host' => [
      $host,
    ],
  ] + $this->headerLines;
  $this->headers = [
    'host' => [
      $host,
    ],
  ] + $this->headers;
}