shouldRedactHeaderValue property

bool Function(String headerName)? shouldRedactHeaderValue
getter/setter pair

Gets or sets a function that determines whether to redact the HTTP header value before logging.

The function accepts a header name and returns true if the header value should be redacted; otherwise, false.

Common headers to redact include:

  • Authorization
  • Cookie
  • Set-Cookie
  • X-Api-Key
  • X-Auth-Token

Implementation

bool Function(String headerName)? shouldRedactHeaderValue;