Redacts sensitive information from headers
The headers to redact
The redacted headers
const headers = { 'Authorization': 'Bearer token123', 'Content-Type': 'application/json', 'Cookie': 'sessionid=abc123' }; const redacted = redactHeaders(headers); // redacted = { 'Authorization': '[REDACTED]', 'Content-Type': 'application/json', 'Cookie': '[REDACTED]' }; Copy
const headers = { 'Authorization': 'Bearer token123', 'Content-Type': 'application/json', 'Cookie': 'sessionid=abc123' }; const redacted = redactHeaders(headers); // redacted = { 'Authorization': '[REDACTED]', 'Content-Type': 'application/json', 'Cookie': '[REDACTED]' };
Redacts sensitive information from headers