Shun Miyazawa 3 years ago
parent
commit
2da9b0e3e8
1 changed files with 4 additions and 4 deletions
  1. 4 4
      packages/app/src/server/crowi/express-init.js

+ 4 - 4
packages/app/src/server/crowi/express-init.js

@@ -71,12 +71,12 @@ module.exports = function(crowi, app) {
 
 
   try {
   try {
     const trustProxy = trustProxyBool ?? trustProxyCsv ?? trustProxyHops;
     const trustProxy = trustProxyBool ?? trustProxyCsv ?? trustProxyHops;
-    if (trustProxy != null) {
-      app.set('trust proxy', trustProxy);
-    }
     if (isNotSpec) {
     if (isNotSpec) {
       // eslint-disable-next-line max-len
       // eslint-disable-next-line max-len
-      logger.warn(`If multiple environment variables TRUST_PROXY_ ~ are set, they are set preferentially in the order of BOOL → CSV → HOPS. Set value: ${app.get('trust proxy')}`);
+      logger.warn(`If multiple environment variables TRUST_PROXY_ ~ are set, they are set preferentially in the order of BOOL → CSV → HOPS. Set value: ${trustProxy}`);
+    }
+    if (trustProxy != null) {
+      app.set('trust proxy', trustProxy);
     }
     }
   }
   }
   catch (err) {
   catch (err) {