Skip to content

Commit 844b585

Browse files
authored
Merge pull request #12 from hhxsv5/master
Fix empty query
2 parents 10bba82 + 74da8cc commit 844b585

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Http/Request.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,11 @@ public function getRequestUri()
9898

9999
// GET/DELETE: move parameters into query
100100
if ($this->isGetOrDeleteMethod() && !empty($this->params)) {
101-
$this->uri .= strpos($this->uri, '?') === false ? '?' : '&';
102-
$this->uri .= http_build_query($this->params);
101+
$query = http_build_query($this->params);
102+
if ($query !== '') {
103+
$this->uri .= strpos($this->uri, '?') === false ? '?' : '&';
104+
$this->uri .= $query;
105+
}
103106
}
104107

105108
$url = $this->baseUri . $this->uri;

0 commit comments

Comments
 (0)