From 58a079bd10808d8d5be183b12a8c0fe74cd73bf1 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 7 Aug 2018 11:56:39 -0700 Subject: [PATCH] include content-length to error response --- src/server/error.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/error.rs b/src/server/error.rs index 4c264bc18..5bd0bf83b 100644 --- a/src/server/error.rs +++ b/src/server/error.rs @@ -16,11 +16,12 @@ impl HttpHandlerTask for ServerError { fn poll_io(&mut self, io: &mut Writer) -> Poll { { let bytes = io.buffer(); - //Buffer should have sufficient capacity for status line - //and extra space + // Buffer should have sufficient capacity for status line + // and extra space bytes.reserve(helpers::STATUS_LINE_BUF_SIZE + 1); 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(); Ok(Async::Ready(true)) }