diff --git a/collector/utils/url/index.js b/collector/utils/url/index.js index 3a7f9072..419c02c2 100644 --- a/collector/utils/url/index.js +++ b/collector/utils/url/index.js @@ -1,6 +1,9 @@ +const VALID_PROTOCOLS = ["https:", "http:"]; + function validURL(url) { try { - new URL(url); + const destination = new URL(url); + if (!VALID_PROTOCOLS.includes(destination.protocol)) return false; return true; } catch {} return false;