From bc9e59315a8353399e39e7d67a3602490b77341c Mon Sep 17 00:00:00 2001 From: Ananya Verma Date: Tue, 27 Aug 2024 15:28:03 +0530 Subject: [PATCH] use URL instance to parse host from url --- Client/src/Pages/Monitors/CreateMonitor/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client/src/Pages/Monitors/CreateMonitor/index.jsx b/Client/src/Pages/Monitors/CreateMonitor/index.jsx index 428248255..f77ca5478 100644 --- a/Client/src/Pages/Monitors/CreateMonitor/index.jsx +++ b/Client/src/Pages/Monitors/CreateMonitor/index.jsx @@ -51,7 +51,7 @@ const CreateMonitor = () => { navigate("/not-found", {replace: true}); } const {name, ...rest} = data; //data.name is read-only - if(rest.type == 'http') rest.url = rest.url.substring(8, rest.url.length) + if(rest.type === 'http') rest.url = URL.parse(rest.url)?.host; rest.name = `${name} (Clone)`; rest.interval /= MS_PER_MINUTE; setMonitor({