DocSpace-buildtools/common/ASC.Socket.IO/app/portalManager.js
Alexey Safronov 5582353715 Update portalManager.js
Commented wrong portalInternalUrl
2022-11-22 14:44:59 +03:00

22 lines
761 B
JavaScript

//const conf = require("../config");
//const portalInternalUrl = conf.get("core")["base-domain"] === "localhost" ? "http://localhost" : ""; //Do not use base-domain for portalInternalUrl
module.exports = (req) => {
//if (portalInternalUrl) return portalInternalUrl; //TODO: Fix internal api url setup after external api domain complete
const xRewriterUrlInternalHeader = "x-rewriter-url-internal";
if (req.headers && req.headers[xRewriterUrlInternalHeader]) {
return req.headers[xRewriterUrlInternalHeader];
}
const xRewriterUrlHeader = "x-rewriter-url";
if (req.headers && req.headers[xRewriterUrlHeader]) {
return req.headers[xRewriterUrlHeader];
}
if (req?.headers?.origin) {
return req.headers.origin;
}
return "";
};