From a5c1f0922eb740c6ef367f149a64e221ff98c4c1 Mon Sep 17 00:00:00 2001 From: Padmaja <52911293+padms@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:22:48 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Check=20lowercase=20excluding=20?= =?UTF-8?q?queryparam=20#2496?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sanityv3/schemas/validations/validateSlug.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sanityv3/schemas/validations/validateSlug.ts b/sanityv3/schemas/validations/validateSlug.ts index a979cc07f..aa355fbbd 100644 --- a/sanityv3/schemas/validations/validateSlug.ts +++ b/sanityv3/schemas/validations/validateSlug.ts @@ -51,7 +51,8 @@ export const warnHttpOrNotValidSlugExternal = (slug: string) => { if (!slug.startsWith('http')) return true // ignore mailto , tel const isHttp = httpRegex.test(slug) const validSlug = stringIsSlug.test(slug) - const isInvalidEquinorUrl = slug !== slug.toLowerCase() && isEquinorUrl(slug) + const slugWithOutQueryParam = slug.split('?')[0] + const isInvalidEquinorUrl = slugWithOutQueryParam !== slugWithOutQueryParam.toLowerCase() && isEquinorUrl(slug) let message = '' if (isHttp) {