From d7f75f92e04dbcb74e7dcf3993a9c775bbd191f2 Mon Sep 17 00:00:00 2001 From: OFF0 Date: Tue, 20 Dec 2022 22:50:33 +0100 Subject: [PATCH] content: exlcude links to localhost No good reason to link to localhost. --- src/domutil.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/domutil.js b/src/domutil.js index d42aa68..fd76c12 100644 --- a/src/domutil.js +++ b/src/domutil.js @@ -31,6 +31,9 @@ function isValidURL(url) { if (!['', '443', '80'].includes(url.port)) { return false; } + if (url.hostname === 'localhost') { + return false; + } const lastDot = url.hostname.lastIndexOf('.'); if (lastDot < 1) { return false;