Skip to content

Commit d7ab66f

Browse files
fix(client): preserve URL params already embedded in path
1 parent 7608d8b commit d7ab66f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/client.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,9 @@ export class Kernel {
382382
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
383383

384384
const defaultQuery = this.defaultQuery();
385-
if (!isEmptyObj(defaultQuery)) {
386-
query = { ...defaultQuery, ...query };
385+
const pathQuery = Object.fromEntries(url.searchParams);
386+
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
387+
query = { ...pathQuery, ...defaultQuery, ...query };
387388
}
388389

389390
if (typeof query === 'object' && query && !Array.isArray(query)) {

0 commit comments

Comments
 (0)