]> granicus.if.org Git - icinga2/commitdiff
Fix HTTP response parsing for HTTP 1.1
authorNoah Hilverling <noah.hilverling@icinga.com>
Wed, 17 Jan 2018 09:25:00 +0000 (10:25 +0100)
committerNoah Hilverling <noah.hilverling@icinga.com>
Wed, 17 Jan 2018 14:02:33 +0000 (15:02 +0100)
refs #5987

lib/remote/httpresponse.cpp

index ab7458655a2f9422461e1bba9b3d0389392a9a25..fd7578ed010814da9e411623601d2dd9b384960e 100644 (file)
@@ -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"));