Uh oh!
There was an error while loading. Please reload this page.
src: node crashes due to multiline environment value - #52266
src: node crashes due to multiline environment value#52266mertcanaltin wants to merge 5 commits into
Conversation
| assert.strictEqual(process.env.MULTI_SINGLE_QUOTED, 'THIS\nIS\nA\nMULTILINE\nSTRING'); | ||
| assert.strictEqual(process.env.MULTI_BACKTICKED, 'THIS\nIS\nA\n"MULTILINE\'S"\nSTRING'); | ||
| assert.strictEqual(process.env.MULTI_NOT_VALID_QUOTE, '"'); | ||
| assert.strictEqual(process.env.MULTI_NOT_VALID_QUOTE, ''); |
There was a problem hiding this comment.
does this cover all the added code?
There was a problem hiding this comment.
The MULTI_NOT_VALID_QUOTE test makes sure that if there's a line starting with a double quote that doesn't close, we still count it as one single value.
MULTI_NOT_VALID_QUOTE="
IMO we should keep this test to make sure we handle these situations right
There was a problem hiding this comment.
Dotenv interprets this as a single quote " too not an empty value
There was a problem hiding this comment.
yes this preserves the previous code
There was a problem hiding this comment.
I must have done this wrong I will update it today
mertcanaltin
commented
Mar 30, 2024
I wonder if it's normal to get fail afterwards 🤔 |
marco-ippolito
commented
Mar 31, 2024
you can make sure it throws |
mertcanaltin
commented
Apr 6, 2024
I wanted to switch to the code in the main branch and test here, but I got such a test error ➜ nodegit:(dev-52248)✗./nodetest/parallel/test-dotenv.js--NODE_SKIP_FLAG_CHECK
node:assert:126thrownewAssertionError(obj);^AssertionError[ERR_ASSERTION]: Expectedvaluestobe strictly equal:
+actual-expected+undefined-'basic'atObject.<anonymous>(/Users/mert/Desktop/openSource/node/test/parallel/test-dotenv.js:8:8)atModule._compile(node:internal/modules/cjs/loader:1421:14)atModule._extensions..js(node:internal/modules/cjs/loader:1499:10)atModule.load(node:internal/modules/cjs/loader:1232:32)atModule._load(node:internal/modules/cjs/loader:1048:12)atFunction.executeUserEntryPoint[asrunMain](node:internal/modules/run_main:187:14)
at node:internal/main/run_main_module:28:49{generatedMessage: true,code: 'ERR_ASSERTION',actual: undefined,expected: 'basic',operator: 'strictEqual'}Node.jsv22.0.0-pre |
Dotenv::ParseContent includes some improvements to avoid crash problems when processing a multiline value
#52248