From fbdc9866a64bdc805b3d0521e57abae16b2deeb9 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Sun, 1 Oct 2023 21:56:04 +0200 Subject: [PATCH] fix(dynamite_runtime): Skip empty query parameters Signed-off-by: jld3103 --- .../dynamite_runtime/lib/src/dynamite_client.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart b/packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart index 6017bb9c..c5704cf2 100644 --- a/packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart +++ b/packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart @@ -412,12 +412,13 @@ class DynamiteClient { final Uint8List? body, final Set? validStatuses, ) async { + final queryParameters = { + ...baseURL.queryParametersAll, + ...path.queryParametersAll, + }; final uri = baseURL.replace( path: '${baseURL.path}${path.path}', - queryParameters: { - ...baseURL.queryParametersAll, - ...path.queryParametersAll, - }, + queryParameters: queryParameters.isNotEmpty ? queryParameters : null, ); final request = await httpClient.openUrl(method, uri);