Skip to content

Commit

Permalink
Revert previous localhost override; Add special logic for local netwo…
Browse files Browse the repository at this point in the history
…rk localhost override

Cloud-hosted configurations can't load off of localhost (for obvious
reasons)
  • Loading branch information
hobinjk-ptc committed May 31, 2023
1 parent 20ab4e7 commit 1256927
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libraries/objectDefaultFiles/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@
var url = null;
let urlSplit = null;
if (parseInt(Number(defaultPort))) {
url = location.protocol + '//localhost:' + defaultPort;
if (object.ip === spatialObject.serverIp) {
url = location.protocol + '//localhost:' + defaultPort;
} else {
url = location.protocol + '//' + object.ip + ':' + defaultPort;
}
} else {
urlSplit = location.pathname.split('/');
for (let i = 0; i < urlSplit.length; i++) {
Expand All @@ -182,7 +186,7 @@
}
}

url = location.protocol + '//localhost:';
url = location.protocol + '//' + object.ip + ':';
if (location.protocol === 'https:' || location.protocol === 'wss:') url += '' + 443; else url += '' + 80;
if (urlObj.n) url += '/n/' + urlObj.n;
if (urlObj.i) url += '/i/' + urlObj.i;
Expand Down

0 comments on commit 1256927

Please sign in to comment.