Skip to content

Commit 34c5577

Browse files
Add check for comments and empty lines in .env file
1 parent 4ad59b1 commit 34c5577

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

backend/api/Configurations/ConfigurationBuilderExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ public static void AddDotEnvironmentVariables(this WebApplicationBuilder builder
6161
'=',
6262
StringSplitOptions.RemoveEmptyEntries);
6363

64+
if (parts.Length == 0 || parts[0].StartsWith('#'))
65+
continue;
66+
6467
Environment.SetEnvironmentVariable(parts[0], parts[1]);
6568
}
6669

0 commit comments

Comments
 (0)