clj-http
clj-http copied to clipboard
Provide a way to redact headers in ExceptionInfo
Some headers should not be written into logs. However, these headers will appear in the exception info thrown by a bad request. Manually redacting them at the site of logging is error-prone (at best, you lose the stack trace by re-constructing ex-info; at worst, you miss a place).
A better solution is to provide a binding that identifies redacted headers:
(binding [*redact-headers* ["X-MyCleartextPassword"]]
(client/get ...))
Note that this needs to apply to both request and response headers (request headers may be more important).
I agree, this is necessary for people that want to hide authentication headers and the like in exceptions.