Make :status in requests be a stream error
This commit is contained in:
committed by
Sean McArthur
parent
8520f06f93
commit
c38c94cb16
@@ -575,6 +575,11 @@ impl Pseudo {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "unstable")]
|
||||
pub fn set_status(&mut self, value: StatusCode) {
|
||||
self.status = Some(value);
|
||||
}
|
||||
|
||||
pub fn set_scheme(&mut self, scheme: uri::Scheme) {
|
||||
let bytes_str = match scheme.as_str() {
|
||||
"http" => BytesStr::from_static("http"),
|
||||
|
||||
@@ -1410,10 +1410,8 @@ impl proto::Peer for Peer {
|
||||
malformed!("malformed headers: missing method");
|
||||
}
|
||||
|
||||
// Specifying :status for a request is a protocol error
|
||||
if pseudo.status.is_some() {
|
||||
tracing::trace!("malformed headers: :status field on request; PROTOCOL_ERROR");
|
||||
return Err(Error::library_go_away(Reason::PROTOCOL_ERROR));
|
||||
malformed!("malformed headers: :status field on request");
|
||||
}
|
||||
|
||||
// Convert the URI
|
||||
|
||||
Reference in New Issue
Block a user