From 396fe80e76840dea9373ca448b20cf7a9babd2f8 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Thu, 7 Jun 2018 15:08:53 -0700 Subject: [PATCH] fix(server): fix debug assert failure when kept-alive connections see a parse error --- src/proto/h1/conn.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/proto/h1/conn.rs b/src/proto/h1/conn.rs index 364f890c15..45c4050210 100644 --- a/src/proto/h1/conn.rs +++ b/src/proto/h1/conn.rs @@ -550,6 +550,9 @@ where I: AsyncRead + AsyncWrite, return Err(::Error::new_version_h2()) } if let Some(msg) = T::on_error(&err) { + // Drop the cached headers so as to not trigger a debug + // assert in `write_head`... + self.state.cached_headers.take(); self.write_head(msg, None); self.state.error = Some(err); return Ok(());