Skip to main content

redact_url

Function redact_url 

Source
pub fn redact_url(value: &str) -> String
Expand description

Strip credentials (userinfo) from a URL.

https://user:token@host/path becomes https://[REDACTED]@host/path. The scheme, host, port, and path are preserved. Values without a scheme:// authority (scp-like git@host:path, bare local paths) are returned unchanged — they carry no user:secret@ userinfo to leak.