Skip to main content

redact_headers

Function redact_headers 

Source
fn redact_headers(line: &str) -> String
Expand description

X-Emby-Token: abc -> X-Emby-Token: [REDACTED]

Scans forward from a cursor rather than recursing on the rewritten string. The obvious recursive version does not terminate: the replacement keeps the header name, so the next call finds the same header again and recurses until the stack is gone. A test provoked exactly that.