Skip to content

Commit 4463ff7

Browse files
fix(client): preserve URL params already embedded in path
1 parent 884f203 commit 4463ff7

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

292292
const defaultQuery = this.defaultQuery();
293-
if (!isEmptyObj(defaultQuery)) {
294-
query = { ...defaultQuery, ...query };
293+
const pathQuery = Object.fromEntries(url.searchParams);
294+
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
295+
query = { ...pathQuery, ...defaultQuery, ...query };
295296
}
296297

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

0 commit comments

Comments
 (0)