* Redact header values for safe logging * * @param headers - Headers to redact * @returns Headers with values replaced by '***REDACTED***'
( headers: Record<string, string>, )
| 1184 | * @returns Headers with values replaced by '***REDACTED***' |
| 1185 | */ |
| 1186 | function redactHeaders( |
| 1187 | headers: Record<string, string>, |
| 1188 | ): Record<string, string> { |
| 1189 | return Object.fromEntries( |
| 1190 | Object.entries(headers).map(([key]) => [key, '***REDACTED***']), |
| 1191 | ) |
| 1192 | } |
| 1193 | |
| 1194 | /** |
| 1195 | * Redact userinfo (username:password) in a URL to avoid logging credentials. |
no test coverage detected