compass.utilities.event_log.loggable_headers#

loggable_headers(headers)[source]#

HTTP headers as a dict for an event, with secrets redacted

Credentials and cookie values are replaced by <redacted>; cookie names are kept, since they often identify the service in the way (e.g. a firewall’s challenge cookie). Repeated headers are joined with “, “.

Parameters:

headers (mapping or None) – Headers from an HTTP client (httpx or aiohttp) or a plain dict.

Returns:

dict – Lower-cased header names mapped to their (redacted) values.