feat(server): properly handle requests that shouldn't have bodies

This commit is contained in:
Sean McArthur
2014-11-24 21:27:59 -08:00
parent a355092a93
commit a60a67cd1e
3 changed files with 74 additions and 8 deletions

View File

@@ -40,6 +40,13 @@ impl MockStream {
write: MemWriter::new(),
}
}
pub fn with_input(input: &[u8]) -> MockStream {
MockStream {
read: MemReader::new(input.to_vec()),
write: MemWriter::new(),
}
}
}
impl Reader for MockStream {
fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> {