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 1bd1c6d commit 4f9f4a9Copy full SHA for 4f9f4a9
src/validator/is-url.ts
@@ -13,15 +13,11 @@ export class IsUrlConstraint implements ValidatorConstraintInterface {
13
return false
14
}
15
16
- try {
17
- // `url` is an absolute URI without host and protocol. Validating it by
18
- // by using any base URL
19
- const parsedUrl = new URL(url, 'https://example.com')
+ // `url` is an absolute URI without host and protocol. Validating it by
+ // by using any base URL
+ const parsedUrl = new URL(url, 'https://example.com')
20
21
- return !/^\/+$/.test(parsedUrl.pathname)
22
- } catch {
23
- return false
24
- }
+ return !/^\/+$/.test(parsedUrl.pathname)
25
26
27
0 commit comments