From cfd776a5def96f5511a657b2aaa8114a0c06727d Mon Sep 17 00:00:00 2001 From: rafaelsideguide <150964962+rafaelsideguide@users.noreply.github.com> Date: Thu, 3 Oct 2024 17:37:04 -0300 Subject: [PATCH] fix: now urls with params are passing validation example: https://www.granitecreek.com?asljhda=akjshd --- apps/api/src/controllers/v1/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/controllers/v1/types.ts b/apps/api/src/controllers/v1/types.ts index 3781eb78..d21290a3 100644 --- a/apps/api/src/controllers/v1/types.ts +++ b/apps/api/src/controllers/v1/types.ts @@ -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(