mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-24 16:02:59 +01:00
include content-length to error response
This commit is contained in:
parent
16546a707f
commit
58a079bd10
@ -16,11 +16,12 @@ impl HttpHandlerTask for ServerError {
|
|||||||
fn poll_io(&mut self, io: &mut Writer) -> Poll<bool, Error> {
|
fn poll_io(&mut self, io: &mut Writer) -> Poll<bool, Error> {
|
||||||
{
|
{
|
||||||
let bytes = io.buffer();
|
let bytes = io.buffer();
|
||||||
//Buffer should have sufficient capacity for status line
|
// Buffer should have sufficient capacity for status line
|
||||||
//and extra space
|
// and extra space
|
||||||
bytes.reserve(helpers::STATUS_LINE_BUF_SIZE + 1);
|
bytes.reserve(helpers::STATUS_LINE_BUF_SIZE + 1);
|
||||||
helpers::write_status_line(self.0, self.1.as_u16(), bytes);
|
helpers::write_status_line(self.0, self.1.as_u16(), bytes);
|
||||||
}
|
}
|
||||||
|
io.buffer().extend_from_slice(b"\r\ncontent-length: 0\r\n");
|
||||||
io.set_date();
|
io.set_date();
|
||||||
Ok(Async::Ready(true))
|
Ok(Async::Ready(true))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user