diff --git a/src/analyzer/protocol/http/HTTP.cc b/src/analyzer/protocol/http/HTTP.cc index 5d6359a3f8..4cba28ec34 100644 --- a/src/analyzer/protocol/http/HTTP.cc +++ b/src/analyzer/protocol/http/HTTP.cc @@ -470,8 +470,15 @@ void HTTP_Entity::SubmitHeader(mime::MIME_Header* h) else if ( mime::strcasecmp_n(h->get_name(), "transfer-encoding") == 0 ) { + double http_version = 0; + if (http_message->analyzer->GetRequestOngoing()) + http_version = http_message->analyzer->GetRequestVersion(); + else // reply_ongoing + http_version = http_message->analyzer->GetReplyVersion(); + data_chunk_t vt = h->get_value_token(); - if ( mime::strcasecmp_n(vt, "chunked") == 0 ) + if ( mime::strcasecmp_n(vt, "chunked") == 0 && + http_version == 1.1) chunked_transfer_state = BEFORE_CHUNK; } diff --git a/src/analyzer/protocol/http/HTTP.h b/src/analyzer/protocol/http/HTTP.h index d6f7e476a0..1743fd6a54 100644 --- a/src/analyzer/protocol/http/HTTP.h +++ b/src/analyzer/protocol/http/HTTP.h @@ -178,6 +178,11 @@ public: void ConnectionReset() override; void PacketWithRST() override; + double GetRequestVersion() { return request_version; }; + double GetReplyVersion() { return reply_version; }; + int GetRequestOngoing() { return request_ongoing; }; + int GetReplyOngoing() { return reply_ongoing; }; + static analyzer::Analyzer* Instantiate(Connection* conn) { return new HTTP_Analyzer(conn); }