From 960274ada8540064364579cb5a7caeb289ae7340 Mon Sep 17 00:00:00 2001 From: Douman Date: Fri, 19 Oct 2018 07:52:10 +0300 Subject: [PATCH] Refactoring of server output to not exclude HTTP_10 (#552) --- CHANGES.md | 6 ++++++ src/server/output.rs | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 62d2e9157..8ac1724a3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ # Changes +## [0.7.14] - 2018-10-x + +### Fixed + +* HttpServer now treats streaming bodies the same for HTTP/1.x protocols. #549 + ## [0.7.13] - 2018-10-14 ### Fixed diff --git a/src/server/output.rs b/src/server/output.rs index 104700d44..ac89d6440 100644 --- a/src/server/output.rs +++ b/src/server/output.rs @@ -300,10 +300,10 @@ impl Output { Some(true) => { // Enable transfer encoding info.length = ResponseLength::Chunked; - if version == Version::HTTP_11 { - TransferEncoding::chunked(buf) - } else { + if version == Version::HTTP_2 { TransferEncoding::eof(buf) + } else { + TransferEncoding::chunked(buf) } } Some(false) => TransferEncoding::eof(buf), @@ -337,10 +337,10 @@ impl Output { } else { // Enable transfer encoding info.length = ResponseLength::Chunked; - if version == Version::HTTP_11 { - TransferEncoding::chunked(buf) - } else { + if version == Version::HTTP_2 { TransferEncoding::eof(buf) + } else { + TransferEncoding::chunked(buf) } } }