mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 20:20:49 +00:00
Merge 69165cd19b into 9453c8c0c9
This commit is contained in:
commit
7afd105864
2 changed files with 14 additions and 1 deletions
|
|
@ -0,0 +1,13 @@
|
||||||
|
import { describe, it } from "node:test";
|
||||||
|
import assert from "node:assert";
|
||||||
|
import { mergeSafeChainProxyEnvironmentVariables } from "./registryProxy.js";
|
||||||
|
|
||||||
|
describe("registryProxy.environmentVariables", () => {
|
||||||
|
it("should copy environment variables with empty string values", () => {
|
||||||
|
const envVars = mergeSafeChainProxyEnvironmentVariables({
|
||||||
|
EMPTY_VAR: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.strictEqual(envVars.EMPTY_VAR, "");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
@ -66,7 +66,7 @@ export function mergeSafeChainProxyEnvironmentVariables(env) {
|
||||||
// So we only copy the variable if it's not already set in a different case
|
// So we only copy the variable if it's not already set in a different case
|
||||||
const upperKey = key.toUpperCase();
|
const upperKey = key.toUpperCase();
|
||||||
|
|
||||||
if (!proxyEnv[upperKey] && env[key]) {
|
if (!(upperKey in proxyEnv) && env[key] !== undefined) {
|
||||||
proxyEnv[key] = env[key];
|
proxyEnv[key] = env[key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue