Skip to content

Commit

Permalink
Remove ksort for request params
Browse files Browse the repository at this point in the history
  • Loading branch information
kimpepper committed Feb 3, 2025
1 parent 289a387 commit 0dae009
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/OpenSearch/RequestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ public function createRequest(
*/
private function createQuery(array $params): string
{
ksort($params);

return http_build_query(array_map(function ($value) {
// Ensure boolean values are serialized as strings.
if ($value === true) {
Expand Down
2 changes: 1 addition & 1 deletion tests/RequestFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ public function testBoolean(): void
$params = ['foo' => true, 'bar' => false];
$request = $factory->createRequest('GET', 'http://localhost:9200/_search', $params);

$this->assertEquals('bar=false&foo=true', $request->getUri()->getQuery());
$this->assertEquals('foo=true&bar=false', $request->getUri()->getQuery());
}
}

0 comments on commit 0dae009

Please sign in to comment.