Test CONNECT is accepted
This commit is contained in:
committed by
Sean McArthur
parent
f7b3cf6d29
commit
5041a4d428
@@ -113,6 +113,25 @@ impl Mock<frame::Headers> {
|
||||
Mock(frame)
|
||||
}
|
||||
|
||||
pub fn method<M>(self, method: M) -> Self
|
||||
where
|
||||
M: TryInto<http::Method>,
|
||||
M::Error: fmt::Debug,
|
||||
{
|
||||
let method = method.try_into().unwrap();
|
||||
let (id, _, fields) = self.into_parts();
|
||||
let frame = frame::Headers::new(
|
||||
id,
|
||||
frame::Pseudo {
|
||||
scheme: None,
|
||||
method: Some(method),
|
||||
..Default::default()
|
||||
},
|
||||
fields,
|
||||
);
|
||||
Mock(frame)
|
||||
}
|
||||
|
||||
pub fn response<S>(self, status: S) -> Self
|
||||
where
|
||||
S: TryInto<http::StatusCode>,
|
||||
|
||||
Reference in New Issue
Block a user