Learn R Programming

whapi (version 0.0.2)

whapi_redact: Redact sensitive values in headers/cookies

Description

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)

Value

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

Arguments

name

Header or cookie name (character).

value

Header or cookie value (character).

Examples

Run this code
whapi_redact("Authorization", "Bearer abc123")
whapi_redact("Content-Type", "application/json")

Run the code above in your browser using DataLab