We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1720c5f commit 4c70e9bCopy full SHA for 4c70e9b
src/utils/common.ts
@@ -14,15 +14,16 @@ export const isUrl = (url: string): boolean => (url.startsWith('http://') || url
14
export const isUrlEncode = (url: string): boolean => {
15
url = url || ''
16
try {
17
- return url !== decodeURIComponent(url)
+ // the whole url encode or decode shold not use encodeURIComponent or decodeURIComponent
18
+ return url !== decodeURI(url)
19
} catch (e) {
20
// if some error caught, try to let it go
21
return true
22
}
23
24
export const handleUrlEncode = (url: string): string => {
25
if (!isUrlEncode(url)) {
- url = encodeURIComponent(url)
26
+ url = encodeURI(url)
27
28
return url
29
0 commit comments