From d50163d14aa6b22b34ac613c761648294ead1884 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Sat, 19 Feb 2022 13:49:54 +0100 Subject: make exception for localhost while disallowing http:// repo urls --- html/text_entry_list.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/html/text_entry_list.js b/html/text_entry_list.js index 80895c9..f5f6e2c 100644 --- a/html/text_entry_list.js +++ b/html/text_entry_list.js @@ -243,6 +243,10 @@ async function repo_list(dialog_ctx) { if (!/^https:\/\//.test(repo_url)) error_msg = "Repository URLs shoud use https:// schema."; + /* Make exception for localhost while disallowing http://. */ + if (/^http:\/\/(127\.0\.0\.1|localhost)([:/].*)?$/.test(repo_url)) + error_msg = null; + if (error_msg) { dialog.error(dialog_ctx, error_msg); throw error_msg; -- cgit v1.2.3