Skip to content

Commit 2dfdbf7

Browse files
committed
readability
1 parent 4f5abc9 commit 2dfdbf7

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/deploy/apphosting/prepare.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,8 @@ describe("apphosting", () => {
965965
const runtimeEnv: Record<string, EnvMap> = {
966966
foo: {
967967
NG_ALLOWED_HOSTS: {
968-
value: "MY-CUSTOM-DOMAIN.COM,foo-123456789.us-central1.run.app,Another-Domain.com,my-custom-domain.com,MY-CUSTOM-DOMAIN.COM",
968+
value:
969+
"MY-CUSTOM-DOMAIN.COM,foo-123456789.us-central1.run.app,Another-Domain.com,my-custom-domain.com,MY-CUSTOM-DOMAIN.COM",
969970
availability: ["RUNTIME"],
970971
},
971972
},

src/deploy/apphosting/prepare.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -487,20 +487,19 @@ export async function injectAngularEnvVars(
487487
runtimeEnv[backendId] ??= {};
488488
buildEnv[backendId] ??= {};
489489

490-
const ngTrustProxyHeaders = "NG_TRUST_PROXY_HEADERS";
491490
const allowedProxyHeadersValue =
492491
"x-forwarded-host,x-forwarded-port,x-forwarded-proto,x-forwarded-for";
493492

494493
// 1. Inject NG_TRUST_PROXY_HEADERS
495494
// If they have defined RUNTIME env vars for the proxy header though we will log a warning that we're overriding it.
496-
if (runtimeEnv[backendId][ngTrustProxyHeaders]) {
495+
if (runtimeEnv[backendId]["NG_TRUST_PROXY_HEADERS"]) {
497496
logLabeledWarning(
498497
"apphosting",
499-
`Overriding user-defined RUNTIME environment variable ${ngTrustProxyHeaders} with default value: ${allowedProxyHeadersValue}`,
498+
`Overriding user-defined RUNTIME environment variable NG_TRUST_PROXY_HEADERS with default value: ${allowedProxyHeadersValue}`,
500499
);
501500
}
502501

503-
runtimeEnv[backendId][ngTrustProxyHeaders] = {
502+
runtimeEnv[backendId]["NG_TRUST_PROXY_HEADERS"] = {
504503
value: allowedProxyHeadersValue,
505504
availability: ["RUNTIME"],
506505
};

0 commit comments

Comments
 (0)