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

Commit 9a0bcb7

Browse files
committed
test Client::send() with relative uri
1 parent 1634788 commit 9a0bcb7

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ public function send(Request $request = null)
903903
}
904904
}
905905
// If we have no ports, set the defaults
906-
if (! $uri->getPort()) {
906+
if (! $uri->getPort() && $uri->isAbsolute()) {
907907
$uri->setPort($uri->getScheme() == 'https' ? 443 : 80);
908908
}
909909

test/ClientTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,4 +541,11 @@ public function testValidRelativeURI($uri, $isValidRelativeURI)
541541
$client = new Client($uri);
542542
$this->assertSame($isValidRelativeURI, $client->getUri()->isValidRelative());
543543
}
544+
545+
public function testSendRequestWithRelativeURI()
546+
{
547+
$client = new Client('/example');
548+
$client->setAdapter(Test::class);
549+
$client->send();
550+
}
544551
}

0 commit comments

Comments
 (0)