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
|
### Fixed
|
||||||
- Add `Allow` header to `Resource`'s default responses when no routes are matched. [#2949]
|
- 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
|
[#1961]: https://github.com/actix/actix-web/pull/1961
|
||||||
[#2265]: https://github.com/actix/actix-web/pull/2265
|
[#2265]: https://github.com/actix/actix-web/pull/2265
|
||||||
|
|
|
@ -446,10 +446,11 @@ impl fmt::Debug for HttpRequest {
|
||||||
writeln!(f, " headers:")?;
|
writeln!(f, " headers:")?;
|
||||||
for (key, val) in self.headers().iter() {
|
for (key, val) in self.headers().iter() {
|
||||||
// Hide sensitive header from debug output
|
// Hide sensitive header from debug output
|
||||||
if key != http::header::AUTHORIZATION {
|
match key {
|
||||||
writeln!(f, " {:?}: {:?}", key, val)?;
|
&http::header::AUTHORIZATION | &http::header::PROXY_AUTHORIZATION => {
|
||||||
} else {
|
writeln!(f, " {:?}: {:?}", key, "*redacted*")?
|
||||||
writeln!(f, " {:?}: {:?}", key, "*redacted*")?;
|
}
|
||||||
|
_ => writeln!(f, " {:?}: {:?}", key, val)?,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Reference in New Issue