We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 029bf7e commit 56a2585Copy full SHA for 56a2585
src/Psr7/Message/Request.php
@@ -32,12 +32,16 @@ public function getRequestTarget(): string
32
return $this->requestTarget;
33
}
34
35
- $this->requestTarget = $this->uri->getPath();
+ $target = $this->uri->getPath();
36
+ if ($target === "") {
37
+ $target = "/";
38
+ }
39
+
40
if ($this->uri->getQuery()) {
- $this->requestTarget .= '?' . $this->uri->getQuery();
41
+ $target .= '?' . $this->uri->getQuery();
42
43
- return $this->requestTarget;
44
+ return $target;
45
46
47
/**
0 commit comments