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:
Carl Lerche
2017-08-30 18:23:23 -04:00
parent a466646e19
commit 0b1fbc4b39
2 changed files with 12 additions and 1 deletions

View File

@@ -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()
}
}

View File

@@ -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 {