From e0cfeea1c0776ace3382c9b44ff07991c9ec1e8b Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Tue, 3 Dec 2024 17:07:30 +0100 Subject: [PATCH] change(ui): webhooks url allow port --- frontend/app/validate.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/app/validate.js b/frontend/app/validate.js index de9b4bdc2..fb4d87c59 100644 --- a/frontend/app/validate.js +++ b/frontend/app/validate.js @@ -5,7 +5,7 @@ export function validateIP(value) { export function validateURL(value) { if (typeof value !== 'string') return false; - const urlRegex = /^(http|https):\/\/(?:www\.)?[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,}(\/\S*)?$/i; + const urlRegex = /^(http|https):\/\/(?:www\.)?[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,}(:\d+)?(\/\S*)?$/i; const ipRegex = /^(http|https):\/\/(?:localhost|(\d{1,3}\.){3}\d{1,3})(:\d+)?(\/\S*)?$/i; return urlRegex.test(value) || ipRegex.test(value); } @@ -89,4 +89,4 @@ export const validatePassword = (password) => { const regex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?])[A-Za-z\d!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]{8,}$/; return regex.test(password); -}; \ No newline at end of file +};