Compare commits

...

1 Commits

Author SHA1 Message Date
Meghan Denny
a0b6fec97d node: fix test-http-debug.js 2025-04-29 22:35:27 -07:00
2 changed files with 15 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ let $debug_log_enabled = ((env) => (
|| (env.BUN_DEBUG_${pathToUpperSnakeCase(publicName)})
|| (env.DEBUG_${pathToUpperSnakeCase(filepath)})
))(Bun.env);
${publicName === "http" || publicName === "http2" ? `if ($debug_log_enabled) process.emitWarning("Setting the BUN_DEBUG_JS environment variable to '${publicName.toLowerCase()}' can expose sensitive data (such as passwords, tokens and authentication headers) in the resulting log.");` : ""}
let $debug_pid_prefix = Bun.env.SHOW_PID === '1';
let $debug_log = $debug_log_enabled ? (...args) => {
// warn goes to stderr without colorizing

View File

@@ -0,0 +1,14 @@
'use strict';
require('../common');
const assert = require('assert');
const child_process = require('child_process');
const path = require('path');
process.env.BUN_DEBUG_JS = 'http';
const { stderr } = child_process.spawnSync(process.execPath, [
path.resolve(__dirname, 'test-http-conn-reset.js'),
], { encoding: 'utf8' });
assert(stderr.match(/Setting the BUN_DEBUG_JS environment variable to 'http' can expose sensitive data \(such as passwords, tokens and authentication headers\) in the resulting log\./),
stderr);