From e5cf2abf0a7fa64dbf7fafafd61870e9041b74a5 Mon Sep 17 00:00:00 2001 From: fakeshadow <24548779@qq.com> Date: Mon, 18 Jan 2021 09:58:37 +0800 Subject: [PATCH] revert change of ResponseHead --- actix-http/src/message.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/actix-http/src/message.rs b/actix-http/src/message.rs index 7daffef79..5d9f3710e 100644 --- a/actix-http/src/message.rs +++ b/actix-http/src/message.rs @@ -414,13 +414,9 @@ impl std::ops::DerefMut for BoxedResponseHead { impl Drop for BoxedResponseHead { fn drop(&mut self) { - RESPONSE_POOL.with(move |p| { - p.release( - self.head - .take() - .expect("ResponseHead is taken before dropped"), - ) - }) + if let Some(head) = self.head.take() { + RESPONSE_POOL.with(move |p| p.release(head)) + } } }