Skip to content

Commit

Permalink
fix: prevent URI encoding (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
chiefGui authored Oct 5, 2021
1 parent 731a8cb commit ac8c1aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function emitRequest<TResponse extends any = {}>(url: string, init?: Reque
function generateQuery<T extends Record<string, string | number | boolean> = {}>(url: string, params?: T) {
let query = '?';
if (params) {
for (const [key, value] of Object.entries(params)) query += `${key}=${encodeURIComponent(value)}&`;
for (const [key, value] of Object.entries(params)) query += `${key}=${value}&`;
query = query.slice(0, -1); // Remove trailing "&"
}
return params ? `${url}${query}` : url;
Expand Down

0 comments on commit ac8c1aa

Please sign in to comment.