reject connection-specific headers (#173)

- When receiving, return a PROTOCOL_ERROR.
- When sending, return a user error about malformed headers.

Closes #36
This commit is contained in:
Sean McArthur
2017-11-14 11:16:29 -08:00
committed by GitHub
parent 05abb686cf
commit 79003d0d45
6 changed files with 114 additions and 2 deletions

View File

@@ -44,6 +44,9 @@ pub enum UserError {
///
/// A new connection is needed.
OverflowedStreamId,
/// Illegal headers, such as connection-specific headers.
MalformedHeaders,
}
// ===== impl RecvError =====
@@ -121,6 +124,7 @@ impl error::Error for UserError {
Rejected => "rejected",
ReleaseCapacityTooBig => "release capacity too big",
OverflowedStreamId => "stream ID overflowed",
MalformedHeaders => "malformed headers",
}
}
}