Merge pull request #732 from mendableai/fix/url-validation-params

[BUG] Fixed URLs with params
This commit is contained in:
Nicolas 2024-10-03 17:43:37 -03:00 committed by GitHub
commit 497ac3328b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,7 +26,7 @@ export const url = z.preprocess(
.url()
.regex(/^https?:\/\//, "URL uses unsupported protocol")
.refine(
(x) => /\.[a-z]{2,}(\/|$)/i.test(x),
(x) => /\.[a-z]{2,}([\/?#]|$)/i.test(x),
"URL must have a valid top-level domain or be a valid path"
)
.refine(