From 16fc740397cbc1c4985e2e58fcca79fe04743966 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Thu, 1 Aug 2024 11:59:32 +0400 Subject: [PATCH] fix: trim \r from message mime type couldn't be parsed because of this --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 39c99d1..30618e8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -79,6 +79,9 @@ impl Client { message.push(buf[0].into()); } } + if message.last().is_some_and(|c| c == &b'\r') { + message.pop(); + } let message = String::from_utf8(message)?; Ok(Response::new(status, message, stream)) }