Skip to content

Commit b460e46

Browse files
committed
add test to CURLRequestTest
1 parent 7367826 commit b460e46

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

system/HTTP/URI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ public function resolveRelativeURI(string $uri)
10401040
* NOTE: We don't use removeDotSegments in this
10411041
* algorithm since it's already done by this line!
10421042
*/
1043-
$relative = new self($uri);
1043+
$relative = new self($uri, $this->rawQueryString);
10441044

10451045
if ($relative->getScheme() === $this->getScheme()) {
10461046
$relative = $relative->withScheme('');

tests/system/HTTP/CURLRequestTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,17 @@ public function testGetRemembersBaseURI(): void
9494
$this->assertSame('http://www.foo.com/api/v1/products', $options[CURLOPT_URL]);
9595
}
9696

97+
public function testGetPreservesDottedQueryKeysFromBaseURI(): void
98+
{
99+
$request = $this->getRequest(['baseURI' => 'https://api.example.com/resource?foo.bar=baz']);
100+
101+
$request->get('');
102+
103+
$options = $request->curl_options;
104+
105+
$this->assertSame('https://api.example.com/resource?foo.bar=baz', $options[CURLOPT_URL]);
106+
}
107+
97108
/**
98109
* @see https://github.com/codeigniter4/CodeIgniter4/issues/1029
99110
*/

0 commit comments

Comments
 (0)