FileStorage.js Including Localhost IP Addr Also

This commit is contained in:
Smidy13 committed 2021-03-28 02:26:42 +00:00
1 parent eb969767cd
commit e9fdc0e50b
1 file changed
+2 -2
@@ -87,7 +87,7 @@ exports.newFileStorage = function newFileStorage(processIndex, host, port) {
logger.write(MODULE_NAME, '[INFO] FileStorage -> getTextFile -> fileLocation: ' + fileLocation)
/* Here we actually reaad the file. */
if (host === undefined || host === 'localhost' || host === ip.address()) {
if (host === undefined || host === 'localhost' || host === ip.address() || host === '127.0.0.1') {
/* We read the file from the local file system. */
const fs = require('fs')
fs.readFile(fileLocation, onFileRead)
@@ -159,7 +159,7 @@ exports.newFileStorage = function newFileStorage(processIndex, host, port) {
if (canUsePrevious === true) {
logger.write(MODULE_NAME, '[WARN] FileStorage -> getTextFile -> onFileRead -> Could read the file, but could not parse it as it is not a valid JSON. Will try to read the PREVIOUS version instead. -> file = ' + fileLocation)
if (host === undefined || host === 'localhost' || host === ip.address()) {
if (host === undefined || host === 'localhost' || host === ip.address() || host === '127.0.0.1') {
/* We read the file from the local file system. */
const fs = require('fs')
fs.readFile(fileLocation + '.Previous.json', onPreviousFileRead)