Skip to content

Commit 8651c0b

Browse files
author
Tiago Siebler
committed
fix(#99): omit url suffix when query params are empty
1 parent a6a6a98 commit 8651c0b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib/BaseRestClient.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,11 @@ export abstract class BaseRestClient {
540540
Timestamp: signResult.timestamp,
541541
};
542542

543-
const urlWithQueryParams =
544-
options.url + '?' + signResult.queryParamsWithSign;
543+
const urlSuffix = signResult.queryParamsWithSign
544+
? '?' + signResult.queryParamsWithSign
545+
: '';
546+
547+
const urlWithQueryParams = options.url + urlSuffix;
545548

546549
if (method === 'GET' || !params?.body) {
547550
return {

0 commit comments

Comments
 (0)