diff options
| author | (quasar) nebula <qznebula@protonmail.com> | 2026-04-12 07:42:26 -0300 |
|---|---|---|
| committer | (quasar) nebula <qznebula@protonmail.com> | 2026-04-12 07:44:39 -0300 |
| commit | 5fcd8ce38402c6623b57a5dc846c9786a24644f1 (patch) | |
| tree | 558302026e5b08bf80b3c51e4c5008de4ba4a950 | |
| parent | 5b03e4f671f45378de5ebb006f05cf288805aa66 (diff) | |
validators: isURL: try decodeURIComponent on pathname
| -rw-r--r-- | src/validators.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/validators.js b/src/validators.js index 1c9ce9e3..73fcf7bc 100644 --- a/src/validators.js +++ b/src/validators.js @@ -710,7 +710,11 @@ export function isName(name) { export function isURL(string) { isStringNonEmpty(string); - new URL(string); + // This might error. + const url = new URL(string); + + // This might, too. + decodeURIComponent(url.pathname); return true; } |