Skip to content

Commit d2a5067

Browse files
authored
Merge pull request #100 from tiagosiebler/fix99urlsuffix
fix(#99): omit url suffix when query params are empty
2 parents a6a6a98 + 8651c0b commit d2a5067

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)