Skip to content

Commit cda7665

Browse files
change encodeURIComponet to encodeURI
1 parent 8aecdf6 commit cda7665

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/fetcher.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function queryString(params: Record<string, unknown>): string {
2525
const qs: string[] = []
2626

2727
const encode = (key: string, value: unknown) =>
28-
`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`
28+
`${encodeURI(key)}=${encodeURI(String(value))}`
2929

3030
Object.keys(params).forEach((key) => {
3131
const value = params[key]
@@ -47,7 +47,7 @@ function queryString(params: Record<string, unknown>): string {
4747

4848
function getPath(path: string, payload: Record<string, any>) {
4949
return path.replace(/\{([^}]+)\}/g, (_, key) => {
50-
const value = encodeURIComponent(payload[key])
50+
const value = encodeURI(payload[key])
5151
delete payload[key]
5252
return value
5353
})

0 commit comments

Comments
 (0)