You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
util.parseEnv creates keys from invalid, newline-separated lines #56775
I think dotenv's behavior is more correct. But dotenv also supports multiline arguments. I think we shouldn't accept newline characters when parsing key's
I'll go with whatever the consensus is, but IMHO foo and bar in that example shouldn't set to true, since there is no =. sign. It seems like stricter behavior would be safer.
Activity
anonrig commentedon Jan 26, 2025
How does dotenv handle this? I think this is expected behavior.
AugustinMauroy commentedon Jan 26, 2025
IMO node should output:
and dotenv do that
anonrig commentedon Jan 26, 2025
I think dotenv's behavior is more correct. But dotenv also supports multiline arguments. I think we shouldn't accept newline characters when parsing key's
AugustinMauroy commentedon Jan 26, 2025
I never heard about that. Could you give me an example.
you mean that ?
anonrig commentedon Jan 26, 2025
Line 72 of https://github.com/nodejs/node/blob/main/test/parallel/test-dotenv.js
AugustinMauroy commentedon Jan 26, 2025
+1 for Dotenv behavior. We should use same fixtures
Can I fix this issue ? i know the answers is yes But I mean is it an easy task.
And where is the affected code ?
anonrig commentedon Jan 26, 2025
Yes, node_dotenv.cc
jonschlinkert commentedon Jan 27, 2025
I think multiline arguments are more common than multiline keys
jonschlinkert commentedon Jan 27, 2025
I'll go with whatever the consensus is, but IMHO
fooandbarin that example shouldn't set totrue, since there is no=. sign. It seems like stricter behavior would be safer.jonschlinkert commentedon Jan 27, 2025
Since one doesn't exist, I thought i would get a spec started for
.env: https://github.com/env-lang/env/blob/main/env.mdI'm open to any level of contributions if anyone is interested.
util: fix parseEnv handling of invalid lines
util: fix parseEnv handling of invalid lines
util: fix parseEnv handling of invalid lines
util: fix parseEnv handling of invalid lines
util: fix parseEnv handling of invalid lines
util: fix parseEnv handling of invalid lines
util: fix parseEnv handling of invalid lines
util: fix parseEnv handling of invalid lines
util: fix parseEnv handling of invalid lines
util: fix parseEnv handling of invalid lines