Skip to content

Commit

Permalink
refactor(http): use native URLSearchParams where possible (#3633)
Browse files Browse the repository at this point in the history
Refs #3606
Refs #3585
  • Loading branch information
char0n authored Aug 11, 2024
1 parent 618f13c commit b60937f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/http/serializers/request/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ export function serializeRequest(req = {}) {
let newStr = '';

if (oriSearch) {
const oriQuery = qs.parse(oriSearch);
const oriQuery = new URLSearchParams(oriSearch);
const keysToRemove = Object.keys(query);
keysToRemove.forEach((key) => delete oriQuery[key]);
newStr = qs.stringify(oriQuery, { encode: true });
keysToRemove.forEach((key) => oriQuery.delete(key));
newStr = String(oriQuery);
}

const finalStr = joinSearch(newStr, encodeFormOrQuery(query));
Expand Down

0 comments on commit b60937f

Please sign in to comment.