diff --git a/lib/src/generators/client.dart b/lib/src/generators/client.dart index 68dc5a4..01c466a 100644 --- a/lib/src/generators/client.dart +++ b/lib/src/generators/client.dart @@ -560,10 +560,13 @@ class $clientName { path: path, ); - String hostDecoded = Uri.decodeFull(host); - if (host.isNotEmpty) { - hostDecoded = Uri.decodeFull(uri.authority); - } + String hostDecoded = Uri.decodeFull( + Uri( + host: host, + port: uri.port, + scheme: uri.scheme, + ).toString(), + ); String uriDecoded = Uri.decodeFull(uri.toString()); if (!serverUri.hasAuthority) {