Skip to content

Replaces sensitive header or cookie values (e.g., Authorization, Cookie, X-API-Key) with the literal string "<redacted>". Useful when logging HTTP requests while avoiding credential leaks.

Usage

whapi_redact(name, value)

Arguments

name

Header or cookie name (character).

value

Header or cookie value (character).

Value

The original value, or "<redacted>" if the header is considered sensitive.

Examples

whapi_redact("Authorization", "Bearer abc123")
#> [1] "<redacted>"
whapi_redact("Content-Type", "application/json")
#> [1] "application/json"