fix: now urls with params are passing validation

example: https://www.granitecreek.com?asljhda=akjshd
This commit is contained in:
rafaelsideguide 2024-10-03 17:37:04 -03:00
parent a150aa820c
commit cfd776a5de

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(