From 47c779fd9af5ff5cd4a6bde7090c40bd335dd463 Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Mon, 15 Jan 2024 16:41:50 +0100 Subject: [PATCH] Remove error log for getDomain --- client/lib/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/lib/utils.js b/client/lib/utils.js index 4a8b728..7d3df6f 100644 --- a/client/lib/utils.js +++ b/client/lib/utils.js @@ -61,10 +61,10 @@ export const getHost = function () { export const getDomain = function (url) { if (url.includes('localhost')) return 'localhost' try { + if (!url.startsWith('http')) url = 'https://' + url return (new URL(url)).hostname } catch (e) { - console.error('Error extracting domai from: ',url,e) - return null + return url } }