This commit is contained in:
2021-08-30 14:08:42 +08:00
parent d8035412c0
commit d8b4ed58c7
+3 -1
View File
@@ -2,7 +2,6 @@
namespace Server\Message;
use JetBrains\PhpStorm\Pure;
use Psr\Http\Message\UriInterface;
@@ -206,6 +205,9 @@ class Uri implements UriInterface
*/
public function __toString(): string
{
if (empty($this->query) && empty($this->fragment)) {
return sprintf('%s://%s:%d%s', $this->scheme, $this->host, $this->port, $this->path);
}
return sprintf('%s://%s:%d%s?%s#%s', $this->scheme, $this->host, $this->port,
$this->path, $this->query, $this->fragment);
}