Exclude possibly sensitive data from logs
Header fields and data frames can potentially contain sensitive data. This change omits these from Debug output which reduces the chance that this ends up in logs.
This commit is contained in:
@@ -119,6 +119,7 @@ impl<T> fmt::Debug for Data<T> {
|
||||
.field("stream_id", &self.stream_id)
|
||||
.field("flags", &self.flags)
|
||||
.field("pad_len", &self.pad_len)
|
||||
// `data` purposefully excluded
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ use std::io::Cursor;
|
||||
/// Header frame
|
||||
///
|
||||
/// This could be either a request or a response.
|
||||
#[derive(Debug)]
|
||||
pub struct Headers {
|
||||
/// The ID of the stream with which this frame is associated.
|
||||
stream_id: StreamId,
|
||||
@@ -319,6 +318,17 @@ impl<T> From<Headers> for Frame<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Headers {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
f.debug_struct("Headers")
|
||||
.field("stream_id", &self.stream_id)
|
||||
.field("stream_dep", &self.stream_dep)
|
||||
.field("flags", &self.flags)
|
||||
// `fields` and `pseudo` purposefully not included
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
// ===== impl PushPromise =====
|
||||
|
||||
impl PushPromise {
|
||||
|
||||
Reference in New Issue
Block a user