initialize($uri, $method, $body, $headers); } /** * {@inheritdoc} */ public function getHeaders() { $headers = $this->headers; if (! $this->hasHeader('host') && ($this->uri && $this->uri->getHost()) ) { $headers['Host'] = [$this->getHostFromUri()]; } return $headers; } /** * {@inheritdoc} */ public function getHeader($header) { if (! $this->hasHeader($header)) { if (strtolower($header) === 'host' && ($this->uri && $this->uri->getHost()) ) { return [$this->getHostFromUri()]; } return []; } $header = $this->headerNames[strtolower($header)]; $value = $this->headers[$header]; $value = is_array($value) ? $value : [$value]; return $value; } }