Fix Query URL
This commit is contained in:
parent
945c7c590c
commit
55831a85db
@ -422,6 +422,10 @@ trait HttpClientTrait
|
||||
$url['path'] = '/';
|
||||
}
|
||||
|
||||
if ('?' === ($url['query'] ?? '')) {
|
||||
$url['query'] = null;
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,9 @@ class HttpClientTraitTest extends TestCase
|
||||
yield ['http://example.com/?a=2&b=b', '.?a=2'];
|
||||
yield ['http://example.com/?a=3&b=b', '.', ['a' => 3]];
|
||||
yield ['http://example.com/?a=3&b=b', '.?a=0', ['a' => 3]];
|
||||
yield ['http://example.com/', 'http://example.com/', ['a' => null]];
|
||||
yield ['http://example.com/?b=', 'http://example.com/', ['b' => '']];
|
||||
yield ['http://example.com/?b=', 'http://example.com/', ['a' => null, 'b' => '']];
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user