From e3f4e806cad703def89c7a96c06bda8dfd94990a Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 18 Jul 2020 19:03:39 +0200 Subject: server.rs: Remove canonical status name from "Status" header This seemed to cause the name to be doubled in the final Apache HTTP header. Since it could cause that issue and is not necessary, we can remove it. --- src/server.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server.rs b/src/server.rs index d23ab9d..d9eee95 100644 --- a/src/server.rs +++ b/src/server.rs @@ -105,9 +105,8 @@ where H: Handler + 'static + Sync write!( &mut stdout, - "Status: {} {}\r\n", + "Status: {}\r\n", head.status.as_str(), - head.status.canonical_reason().unwrap_or("UNKNOWN"), )?; for (name, value) in head.headers.iter() { @@ -136,9 +135,8 @@ fn internal_server_error(mut w: W) { write!( w, - "Status: {} {}\r\n{}\r\n\r\n", + "Status: {}\r\n{}\r\n\r\n", code, - code.canonical_reason().unwrap_or_default(), "Content-Length: 0", ) .unwrap_or_else(|e| error!("Write error: {}", e)) -- cgit v1.2.3