(headers: Record<string, any> | undefined | null)
| 83 | * templates, observers, or logs. Comparison is case-insensitive; non-sensitive headers pass through. |
| 84 | */ |
| 85 | export function redactSensitiveHeaders(headers: Record<string, any> | undefined | null): Record<string, any> { |
| 86 | if (!headers) return {} |
| 87 | const out: Record<string, any> = {} |
| 88 | for (const [key, value] of Object.entries(headers)) { |
| 89 | out[key] = SENSITIVE_HEADER_NAMES.has(key.toLowerCase()) ? REDACTED_PLACEHOLDER : value |
| 90 | } |
| 91 | return out |
| 92 | } |
no outgoing calls
no test coverage detected