mirror of https://github.com/fafhrd91/actix-web
fix: also hide proxy-authorization
As reccomended by robjtede
This commit is contained in:
parent
9482d2972a
commit
199aa5a40e
|
@ -10,7 +10,7 @@
|
|||
|
||||
### Fixed
|
||||
- Add `Allow` header to `Resource`'s default responses when no routes are matched. [#2949]
|
||||
- Hide `Authorization` header in `HttpRequest` Debug output
|
||||
- Hide `Authorization` and `Proxy-Authorization` header in `HttpRequest` Debug output
|
||||
|
||||
[#1961]: https://github.com/actix/actix-web/pull/1961
|
||||
[#2265]: https://github.com/actix/actix-web/pull/2265
|
||||
|
|
|
@ -446,10 +446,11 @@ impl fmt::Debug for HttpRequest {
|
|||
writeln!(f, " headers:")?;
|
||||
for (key, val) in self.headers().iter() {
|
||||
// Hide sensitive header from debug output
|
||||
if key != http::header::AUTHORIZATION {
|
||||
writeln!(f, " {:?}: {:?}", key, val)?;
|
||||
} else {
|
||||
writeln!(f, " {:?}: {:?}", key, "*redacted*")?;
|
||||
match key {
|
||||
&http::header::AUTHORIZATION | &http::header::PROXY_AUTHORIZATION => {
|
||||
writeln!(f, " {:?}: {:?}", key, "*redacted*")?
|
||||
}
|
||||
_ => writeln!(f, " {:?}: {:?}", key, val)?,
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
|
Loading…
Reference in New Issue