From f3d16a5e9bfbc00f6f9322cbd7b318500a263a5c Mon Sep 17 00:00:00 2001 From: Kot Date: Mon, 27 Jan 2025 18:53:18 -0600 Subject: [PATCH] Remove body from error responses too --- src/server.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server.rs b/src/server.rs index 7ba64a3..0160dfa 100644 --- a/src/server.rs +++ b/src/server.rs @@ -267,13 +267,13 @@ impl Server { Ok(res) } - Err(msg) => new_boilerplate(def_headers, req_headers, 500, Body::from(msg)).await, + Err(msg) => new_boilerplate(def_headers, req_headers, 500, if is_head { Body::empty() } else { Body::from(msg) }).await, } } .boxed() } // If there was a routing error - Err(e) => new_boilerplate(def_headers, req_headers, 404, e.into()).boxed(), + Err(e) => new_boilerplate(def_headers, req_headers, 404, if is_head { Body::empty() } else { e.into() }).boxed(), } })) }