@@ -34663,6 +34663,9 @@ function httpRedirectFetch (fetchParams, response) {
3466334663 // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name
3466434664 request.headersList.delete('authorization')
3466534665
34666+ // https://fetch.spec.whatwg.org/#authentication-entries
34667+ request.headersList.delete('proxy-authorization', true)
34668+
3466634669 // "Cookie" and "Host" are forbidden request-headers, which undici doesn't implement.
3466734670 request.headersList.delete('cookie')
3466834671 request.headersList.delete('host')
@@ -45543,16 +45546,21 @@ function run() {
4554345546 // Get and inject secret values
4554445547 for (let secretId of secretIds) {
4554545548 // Optionally let user set an alias, i.e. `ENV_NAME,secret_name`
45546- let secretAlias = '' ;
45549+ let secretAlias = undefined ;
4554745550 [secretAlias, secretId] = (0, utils_1.extractAliasAndSecretIdFromInput)(secretId);
4554845551 // Retrieves the secret name also, if the value is an ARN
4554945552 const isArn = (0, utils_1.isSecretArn)(secretId);
4555045553 try {
4555145554 const secretValueResponse = yield (0, utils_1.getSecretValue)(client, secretId);
45552- if (!secretAlias) {
45555+ const secretValue = secretValueResponse.secretValue;
45556+ // Catch if blank prefix is specified but no json is parsed to avoid blank environment variable
45557+ if ((secretAlias === '') && !(parseJsonSecrets && (0, utils_1.isJSONString)(secretValue))) {
45558+ secretAlias = undefined;
45559+ }
45560+ if (secretAlias === undefined) {
4555345561 secretAlias = isArn ? secretValueResponse.name : secretId;
4555445562 }
45555- const injectedSecrets = (0, utils_1.injectSecret)(secretAlias, secretValueResponse. secretValue, parseJsonSecrets);
45563+ const injectedSecrets = (0, utils_1.injectSecret)(secretAlias, secretValue, parseJsonSecrets);
4555645564 secretsToCleanup = [...secretsToCleanup, ...injectedSecrets];
4555745565 }
4555845566 catch (err) {
@@ -45739,8 +45747,13 @@ function injectSecret(secretName, secretValue, parseJsonSecrets, tempEnvName) {
4573945747 const secretMap = JSON.parse(secretValue);
4574045748 for (const k in secretMap) {
4574145749 const keyValue = typeof secretMap[k] === 'string' ? secretMap[k] : JSON.stringify(secretMap[k]);
45742- // Append the current key to the name of the env variable
45743- const newEnvName = `${tempEnvName || transformToValidEnvName(secretName)}_${transformToValidEnvName(k)}`;
45750+ // Append the current key to the name of the env variable and check to avoid prepending an underscore
45751+ const newEnvName = [
45752+ tempEnvName || transformToValidEnvName(secretName),
45753+ transformToValidEnvName(k)
45754+ ]
45755+ .filter(elem => elem) // Uses truthy-ness of elem to determine if it remains
45756+ .join("_"); // Join the remaining elements with an underscore
4574445757 secretsToCleanup = [...secretsToCleanup, ...injectSecret(secretName, keyValue, parseJsonSecrets, newEnvName)];
4574545758 }
4574645759 }
@@ -45816,7 +45829,7 @@ function extractAliasAndSecretIdFromInput(input) {
4581645829 return [alias, secretId];
4581745830 }
4581845831 // No alias
45819- return ['' , input.trim()];
45832+ return [undefined , input.trim()];
4582045833}
4582145834exports.extractAliasAndSecretIdFromInput = extractAliasAndSecretIdFromInput;
4582245835/*
0 commit comments