Browse Source

fix(dynamite_runtime): Skip empty query parameters

Signed-off-by: jld3103 <jld3103yt@gmail.com>
pull/902/head
jld3103 1 year ago
parent
commit
fbdc9866a6
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 9
      packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart

9
packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart

@ -412,12 +412,13 @@ class DynamiteClient {
final Uint8List? body, final Uint8List? body,
final Set<int>? validStatuses, final Set<int>? validStatuses,
) async { ) async {
final uri = baseURL.replace( final queryParameters = {
path: '${baseURL.path}${path.path}',
queryParameters: {
...baseURL.queryParametersAll, ...baseURL.queryParametersAll,
...path.queryParametersAll, ...path.queryParametersAll,
}, };
final uri = baseURL.replace(
path: '${baseURL.path}${path.path}',
queryParameters: queryParameters.isNotEmpty ? queryParameters : null,
); );
final request = await httpClient.openUrl(method, uri); final request = await httpClient.openUrl(method, uri);

Loading…
Cancel
Save