From c8351e8f0c52ea9bb43e7975920ecf036798b8d3 Mon Sep 17 00:00:00 2001 From: Bad Date: Wed, 21 Oct 2020 19:43:21 +0200 Subject: [PATCH] Warn when assuming https --- src/js/login.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js/login.js b/src/js/login.js index c49ad98..33d2006 100644 --- a/src/js/login.js +++ b/src/js/login.js @@ -80,7 +80,10 @@ class Form extends ElemJS { let currentAddress = homeserver.value let ok = false while (!ok) { - if (!currentAddress.match(/^https?:\/\//)) currentAddress = "https://" + currentAddress + if (!currentAddress.match(/^https?:\/\//)) { + console.warn(`${currentAddress} doesn't specify the protocol, assuming https`) + currentAddress = "https://" + currentAddress + } currentAddress = currentAddress.replace(/\/*$/, "") this.status(`Looking up homeserver... trying ${currentAddress}`) try {