From 812076d4feea655844ac234068f33b6bd350c379 Mon Sep 17 00:00:00 2001 From: Rohan Sreerama Date: Wed, 11 Jun 2025 02:01:44 -0700 Subject: [PATCH] fix(create-call): fix url parsing (#1235) --- lib/http-routes/schemas/create-call.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/http-routes/schemas/create-call.js b/lib/http-routes/schemas/create-call.js index a36ebbe4..ceffd0ae 100644 --- a/lib/http-routes/schemas/create-call.js +++ b/lib/http-routes/schemas/create-call.js @@ -116,8 +116,8 @@ const customSanitizeFunction = (value) => { /* trims characters at the beginning and at the end of a string */ value = value.trim(); - /* Verify strings including 'http' via new URL */ - if (value.includes('http')) { + // Only attempt to parse if the whole string is a URL + if (/^https?:\/\/\S+$/.test(value)) { value = new URL(value).toString(); } }