From 185706185934f0dca3556e43740615756f0c6e75 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Mon, 15 Feb 2021 20:42:08 -0300 Subject: [PATCH] Add a test case for LF line ending response headers --- src/response.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/response.rs b/src/response.rs index caf6ad4..1f50c1b 100644 --- a/src/response.rs +++ b/src/response.rs @@ -646,6 +646,16 @@ mod tests { assert_eq!("application/json", resp.content_type()); } + #[test] + fn content_type_without_cr() { + let s = "HTTP/1.1 200 OK\r\n\ + Content-Type: application/json\n\ + \r\n\ + OK"; + let resp = s.parse::().unwrap(); + assert_eq!("application/json", resp.content_type()); + } + #[test] fn content_type_with_charset() { let s = "HTTP/1.1 200 OK\r\n\