fix(HTTP Request Node): Sanitize authorization headers (#10607)

This commit is contained in:
Shireen Missi
2024-08-29 15:28:03 +01:00
committed by GitHub
parent c4eb3746d7
commit 405c55a1f7
2 changed files with 80 additions and 0 deletions

View File

@@ -88,7 +88,24 @@ export function sanitizeUiMessage(
),
};
}
const HEADER_BLOCKLIST = new Set([
'authorization',
'x-api-key',
'x-auth-token',
'cookie',
'proxy-authorization',
'sslclientcert',
]);
const headers = sendRequest.headers as IDataObject;
if (headers) {
for (const headerName of Object.keys(headers)) {
if (HEADER_BLOCKLIST.has(headerName.toLowerCase())) {
headers[headerName] = REDACTED;
}
}
}
if (secrets && secrets.length > 0) {
return redact(sendRequest, secrets);
}