Repository navigation
fix: honor filter_env true when merging shell env - #6177
Closed
cestercian wants to merge 1 commit into
Closed
cestercian wants to merge 1 commit into
cestercian wants to merge 1 commit into
Conversation
filter_env true never called filterEnv because a boolean has no length, so process.env was still merged into the app. The string "true" from config parsing is the same flag. String and array deny-lists are unchanged.
Owner
|
Thanks @cestercian! Your commit is in
It will ship in 7.1.2. Closing since GitHub doesn't see it as merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
filter_env: trueis supposed to drop the whole CLI environment, butprepareAppConfonly calledfilterEnv()whenfilter_env.length > 0. A boolean has no length, so thetruebranch insidefilterEnv()never ran and all ofprocess.envstill got merged into the app.This checks for
true(and the string"true", which is what you get from some config files) on its own before the length check. String and array forms work exactly like before, and the app's ownenvblock is still layered on top.Tests: added
filter_envcases totest/programmatic/common.mocha.js(true, "true", array, string, and the--filter-envCLI path) and tightened the existingfilter_env: truetest infilter_env.mocha.jsso it actually checks a shell var doesn't leak.common.mocha.js,filter_env.mocha.jsandenv_override.mocha.jsall pass, and the new true case fails without the fix.