From 81459b1632a62519998394cc0f7646b8b71c69ad Mon Sep 17 00:00:00 2001 From: vantezzen Date: Sun, 25 Aug 2019 19:56:44 +0200 Subject: Add explanation for usage of 1.1.1.1 --- src/api/apiBase.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/api/apiBase.js') diff --git a/src/api/apiBase.js b/src/api/apiBase.js index ab47c78ee..ce02922ac 100644 --- a/src/api/apiBase.js +++ b/src/api/apiBase.js @@ -8,10 +8,17 @@ import { const apiBase = () => { let url; - if (!window.ferdi ||  - !window.ferdi.stores.settings ||  - !window.ferdi.stores.settings.all) { + if (!window.ferdi + || !window.ferdi.stores.settings + || !window.ferdi.stores.settings.all) { // Stores have not yet been loaded - send invalid URL to force a retry when stores are loaded + // "Why 1.1.1.1 as the default, invalid URL?" + // 1.1.1.1 is the server for Cloudflare's DNS service and will be the same across most networks. + // Using a random IP could result in unwanted connections, using localhost could unwantedly + // connect to local develoment servers. + // 1.1.1.1 also sends a status 400 response for invalid routes. Other servers may return status 401 + // on some routes. This would result in Ferdi deleting its current authToken as it thinks it + // has gone invalid. url = 'https://1.1.1.1'; } else if (window.ferdi.stores.settings.all.app.server) { // Load URL from store -- cgit v1.2.3-70-g09d2