Skip to content

Commit 51c6c2c

Browse files
fix(client): preserve URL params already embedded in path
1 parent 0489b21 commit 51c6c2c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/client.ts

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

284284
const defaultQuery = this.defaultQuery();
285-
if (!isEmptyObj(defaultQuery)) {
286-
query = { ...defaultQuery, ...query };
285+
const pathQuery = Object.fromEntries(url.searchParams);
286+
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
287+
query = { ...pathQuery, ...defaultQuery, ...query };
287288
}
288289

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

0 commit comments

Comments
 (0)