Use current host as fallback for FS_HOSTNAME
This commit is contained in:
1 parent
7154d2cc7e
commit
7fdcb57e1d
3 files changed
+9
-4
No files matched your search
@@ -6,7 +6,7 @@
|
|||||||
"NBI_PORT" : 7557,
|
"NBI_PORT" : 7557,
|
||||||
"FS_INTERFACE" : "0.0.0.0",
|
"FS_INTERFACE" : "0.0.0.0",
|
||||||
"FS_PORT" : 7567,
|
"FS_PORT" : 7567,
|
||||||
"FS_HOSTNAME" : "acs.example.com",
|
"FS_HOSTNAME" : "",
|
||||||
"UI_INTERFACE" : "0.0.0.0",
|
"UI_INTERFACE" : "0.0.0.0",
|
||||||
"UI_PORT" : 3000,
|
"UI_PORT" : 3000,
|
||||||
"UI_JWT_SECRET": ""
|
"UI_JWT_SECRET": ""
|
||||||
|
|||||||
+1
-1
@@ -62,7 +62,7 @@ const options = {
|
|||||||
FS_INTERFACE: { type: "string", default: "0.0.0.0" },
|
FS_INTERFACE: { type: "string", default: "0.0.0.0" },
|
||||||
FS_SSL_CERT: { type: "string", default: "" },
|
FS_SSL_CERT: { type: "string", default: "" },
|
||||||
FS_SSL_KEY: { type: "string", default: "" },
|
FS_SSL_KEY: { type: "string", default: "" },
|
||||||
FS_HOSTNAME: { type: "string", default: "acs.example.com" },
|
FS_HOSTNAME: { type: "string", default: "" },
|
||||||
FS_LOG_FILE: { type: "path", default: "" },
|
FS_LOG_FILE: { type: "path", default: "" },
|
||||||
FS_ACCESS_LOG_FILE: { type: "path", default: "" },
|
FS_ACCESS_LOG_FILE: { type: "path", default: "" },
|
||||||
|
|
||||||
|
|||||||
+7
-2
@@ -772,10 +772,15 @@ async function sendAcsRequest(
|
|||||||
downloadRequest.fileSize = 0;
|
downloadRequest.fileSize = 0;
|
||||||
if (!downloadRequest.url) {
|
if (!downloadRequest.url) {
|
||||||
const FS_PORT = config.get("FS_PORT");
|
const FS_PORT = config.get("FS_PORT");
|
||||||
const FS_HOSTNAME = config.get("FS_HOSTNAME");
|
|
||||||
const FS_SSL = config.get("FS_SSL");
|
const FS_SSL = config.get("FS_SSL");
|
||||||
|
let hostname = config.get("FS_HOSTNAME");
|
||||||
|
if (!hostname) {
|
||||||
|
if (sessionContext.httpRequest.headers["host"])
|
||||||
|
hostname = sessionContext.httpRequest.headers["host"].split(":")[0];
|
||||||
|
else hostname = sessionContext.httpRequest.connection.localAddress;
|
||||||
|
}
|
||||||
downloadRequest.url = FS_SSL ? "https://" : "http://";
|
downloadRequest.url = FS_SSL ? "https://" : "http://";
|
||||||
downloadRequest.url += FS_HOSTNAME;
|
downloadRequest.url += hostname;
|
||||||
if (FS_PORT !== 80) downloadRequest.url += ":" + FS_PORT;
|
if (FS_PORT !== 80) downloadRequest.url += ":" + FS_PORT;
|
||||||
downloadRequest.url += "/" + encodeURI(downloadRequest.fileName);
|
downloadRequest.url += "/" + encodeURI(downloadRequest.fileName);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user