Skip to content

Commit 09b226d

Browse files
fix(client): preserve URL params already embedded in path
1 parent a625c49 commit 09b226d

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
@@ -269,8 +269,9 @@ export class SFCNodes {
269269
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
270270

271271
const defaultQuery = this.defaultQuery();
272-
if (!isEmptyObj(defaultQuery)) {
273-
query = { ...defaultQuery, ...query };
272+
const pathQuery = Object.fromEntries(url.searchParams);
273+
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
274+
query = { ...pathQuery, ...defaultQuery, ...query };
274275
}
275276

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

0 commit comments

Comments
 (0)