Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 5e72635

Browse files
committed
Merge branch 'hotfix/220'
Close #220
2 parents b1dba8a + 96ec994 commit 5e72635

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/Request.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function getHeaders()
4343
{
4444
$headers = $this->headers;
4545
if (! $this->hasHeader('host')
46-
&& ($this->uri && $this->uri->getHost())
46+
&& $this->uri->getHost()
4747
) {
4848
$headers['Host'] = [$this->getHostFromUri()];
4949
}
@@ -58,7 +58,7 @@ public function getHeader($header)
5858
{
5959
if (! $this->hasHeader($header)) {
6060
if (strtolower($header) === 'host'
61-
&& ($this->uri && $this->uri->getHost())
61+
&& $this->uri->getHost()
6262
) {
6363
return [$this->getHostFromUri()];
6464
}

src/RequestTrait.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ trait RequestTrait
4343
private $requestTarget;
4444

4545
/**
46-
* @var null|UriInterface
46+
* @var UriInterface
4747
*/
4848
private $uri;
4949

@@ -132,10 +132,6 @@ public function getRequestTarget()
132132
return $this->requestTarget;
133133
}
134134

135-
if (! $this->uri) {
136-
return '/';
137-
}
138-
139135
$target = $this->uri->getPath();
140136
if ($this->uri->getQuery()) {
141137
$target .= '?' . $this->uri->getQuery();

0 commit comments

Comments
 (0)