From 157358c24f65bc287c88fdc4c5eb72be29e17ecd Mon Sep 17 00:00:00 2001 From: Noah Hilverling Date: Wed, 17 Jan 2018 10:25:00 +0100 Subject: [PATCH] Fix HTTP response parsing for HTTP 1.1 refs #5987 --- lib/remote/httpresponse.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/remote/httpresponse.cpp b/lib/remote/httpresponse.cpp index ab7458655..fd7578ed0 100644 --- a/lib/remote/httpresponse.cpp +++ b/lib/remote/httpresponse.cpp @@ -208,6 +208,11 @@ bool HttpResponse::Parse(StreamReadContext& src, bool may_wait) lengthIndicator = Convert::ToLong(contentLengthHeader); } + if (!hasLengthIndicator && ProtocolVersion != HttpVersion10 && !Headers->Contains("transfer-encoding")) { + Complete = true; + return true; + } + if (hasLengthIndicator && src.Eof) BOOST_THROW_EXCEPTION(std::invalid_argument("Unexpected EOF in HTTP body")); -- 2.40.0