diff options
author | vantezzen <properly@protonmail.com> | 2019-08-25 19:56:44 +0200 |
---|---|---|
committer | vantezzen <properly@protonmail.com> | 2019-08-25 19:56:44 +0200 |
commit | 81459b1632a62519998394cc0f7646b8b71c69ad (patch) | |
tree | 3599fcd9002ea88b98b128417b245cab34a99628 | |
parent | Remove news due to logout issues (diff) | |
download | ferdium-app-81459b1632a62519998394cc0f7646b8b71c69ad.tar.gz ferdium-app-81459b1632a62519998394cc0f7646b8b71c69ad.tar.zst ferdium-app-81459b1632a62519998394cc0f7646b8b71c69ad.zip |
Add explanation for usage of 1.1.1.1
-rw-r--r-- | src/api/apiBase.js | 13 |
1 files changed, 10 insertions, 3 deletions
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 { | |||
8 | 8 | ||
9 | const apiBase = () => { | 9 | const apiBase = () => { |
10 | let url; | 10 | let url; |
11 | if (!window.ferdi || | 11 | if (!window.ferdi |
12 | !window.ferdi.stores.settings || | 12 | || !window.ferdi.stores.settings |
13 | !window.ferdi.stores.settings.all) { | 13 | || !window.ferdi.stores.settings.all) { |
14 | // Stores have not yet been loaded - send invalid URL to force a retry when stores are loaded | 14 | // Stores have not yet been loaded - send invalid URL to force a retry when stores are loaded |
15 | // "Why 1.1.1.1 as the default, invalid URL?" | ||
16 | // 1.1.1.1 is the server for Cloudflare's DNS service and will be the same across most networks. | ||
17 | // Using a random IP could result in unwanted connections, using localhost could unwantedly | ||
18 | // connect to local develoment servers. | ||
19 | // 1.1.1.1 also sends a status 400 response for invalid routes. Other servers may return status 401 | ||
20 | // on some routes. This would result in Ferdi deleting its current authToken as it thinks it | ||
21 | // has gone invalid. | ||
15 | url = 'https://1.1.1.1'; | 22 | url = 'https://1.1.1.1'; |
16 | } else if (window.ferdi.stores.settings.all.app.server) { | 23 | } else if (window.ferdi.stores.settings.all.app.server) { |
17 | // Load URL from store | 24 | // Load URL from store |