aboutsummaryrefslogtreecommitdiffstats
path: root/src/api
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-08-05 15:03:07 +0530
committerLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-08-05 12:56:30 +0000
commitc1aa23aca9ac88125b34e24f155c577ef5fad39c (patch)
tree7217fe47b4b9335ec766459431d989e487cd964b /src/api
parentrevert: partially reverts the previous change to fix issue that the packaged ... (diff)
downloadferdium-app-c1aa23aca9ac88125b34e24f155c577ef5fad39c.tar.gz
ferdium-app-c1aa23aca9ac88125b34e24f155c577ef5fad39c.tar.zst
ferdium-app-c1aa23aca9ac88125b34e24f155c577ef5fad39c.zip
fix: change all occurrences of hard-coded ip address '127.0.0.1' to 'localhost'
Also refactored to make this a constant defined in a single file where it is imported for all other uses. fixes #1253
Diffstat (limited to 'src/api')
-rw-r--r--src/api/apiBase.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/api/apiBase.js b/src/api/apiBase.js
index 3278dc454..db974c96f 100644
--- a/src/api/apiBase.js
+++ b/src/api/apiBase.js
@@ -7,6 +7,7 @@ import {
7import { 7import {
8 DEV_API_FRANZ_WEBSITE, 8 DEV_API_FRANZ_WEBSITE,
9 LIVE_FRANZ_API, 9 LIVE_FRANZ_API,
10 LOCAL_HOSTNAME,
10 LOCAL_SERVER, 11 LOCAL_SERVER,
11 SERVER_NOT_LOADED, 12 SERVER_NOT_LOADED,
12} from '../config'; 13} from '../config';
@@ -23,7 +24,7 @@ const apiBase = (withVersion = true) => {
23 } 24 }
24 if (window.ferdi.stores.settings.all.app.server === LOCAL_SERVER) { 25 if (window.ferdi.stores.settings.all.app.server === LOCAL_SERVER) {
25 // Use URL for local server 26 // Use URL for local server
26 url = `http://127.0.0.1:${window.ferdi.stores.requests.localServerPort}`; 27 url = `http://${LOCAL_HOSTNAME}:${window.ferdi.stores.requests.localServerPort}`;
27 } else { 28 } else {
28 // Load URL from store 29 // Load URL from store
29 url = window.ferdi.stores.settings.all.app.server; 30 url = window.ferdi.stores.settings.all.app.server;