Skip to content

Commit 81e7709

Browse files
authored
Merge pull request #578 from fendor/fix/security-list-env-vars
List Env Vars we care about only
2 parents afcc93c + f51d543 commit 81e7709

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/extension.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,12 @@ async function activateServerForFolder(context: ExtensionContext, uri: Uri, fold
142142
}
143143
logger.log('Environment variables:');
144144
Object.entries(process.env).forEach(([key, value]: [string, string | undefined]) => {
145-
logger.log(` ${key}: ${value}`);
145+
// only list environment variables that we actually care about.
146+
// this makes it safe for users to just paste the logs to whoever,
147+
// and avoids leaking secrets.
148+
if (["PATH"].includes(key)) {
149+
logger.log(` ${key}: ${value}`);
150+
}
146151
});
147152

148153
let serverExecutable: string;

0 commit comments

Comments
 (0)