From 0d9eddf1c77447d7bf59b83fe8f9bc2f1d7b6d9e Mon Sep 17 00:00:00 2001 From: jay-dee7 Date: Mon, 13 Oct 2025 22:16:09 +0530 Subject: [PATCH] fix: Remove TLD check on Joi email schema for URLs --- src/schemas/UpcomingPassInformation.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/schemas/UpcomingPassInformation.ts b/src/schemas/UpcomingPassInformation.ts index 81d1176..0453285 100644 --- a/src/schemas/UpcomingPassInformation.ts +++ b/src/schemas/UpcomingPassInformation.ts @@ -114,7 +114,12 @@ const URLs = Joi.object({ accessibilityURL: Joi.string().regex(URL_REGEX), addOnURL: Joi.string().regex(URL_REGEX), bagPolicyURL: Joi.string().regex(URL_REGEX), - contactVenueEmail: Joi.string().email(), + /** + * Joi's email schema validates email TLDs and only allows TLDs that are registered in the IANA Registry. + * This also requires NodeJS runtime to work (even though can be enabled client side, but discouraged) + * Reference - https://github.com/hapijs/joi/issues/2390 + */ + contactVenueEmail: Joi.string().email({ tlds: false }), contactVenuePhoneNumber: Joi.string(), contactVenueWebsite: Joi.string().regex(URL_REGEX), directionsInformationURL: Joi.string().regex(URL_REGEX),