Browse Source

fix: env var resolution part 2

Sv443 4 months ago
parent
commit
12402e254c
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/env.ts
  2. 1 1
      src/server.ts

+ 1 - 1
src/env.ts

@@ -34,7 +34,7 @@ export function getEnvVar(name: string, type: EnvVarConvType = "string", default
   }
 }
 
-/** Checks if the env var with the given {@linkcode name} equals the given {@linkcode value}, converted to a string */
+/** Checks if the env var with the given {@linkcode name} equals the given {@linkcode value}, converted to a string - falls back to {@linkcode defaultVal} if the env var is not set */
 export function envVarEquals(name: string, value: Stringifiable, defaultVal = true): boolean {
   const val = getEnvVar(name, "string", String(defaultVal));
   return (typeof value === "boolean" ? val.toLowerCase() : val) === String(value);

+ 1 - 1
src/server.ts

@@ -31,7 +31,7 @@ app.use(compression({
 
 app.use(express.json());
 
-if(envVarEquals("TRUST_PROXY", true, false))
+if(!envVarEquals("TRUST_PROXY", false, false))
   app.enable("trust proxy");
 
 app.disable("x-powered-by");