aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-02-19 13:49:54 +0100
committerWojtek Kosior <koszko@koszko.org>2022-02-19 13:51:20 +0100
commitd50163d14aa6b22b34ac613c761648294ead1884 (patch)
treeec7069d5a27f2638190f4f7591776ed39f8821db
parent43397bb9e40897560ad2a58c82cc8b7e3e257fbc (diff)
downloadbrowser-extension-d50163d14aa6b22b34ac613c761648294ead1884.tar.gz
browser-extension-d50163d14aa6b22b34ac613c761648294ead1884.zip
make exception for localhost while disallowing http:// repo urls
-rw-r--r--html/text_entry_list.js4
1 files changed, 4 insertions, 0 deletions
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;