From f8f65810dffd7854bbba2122462d2bab53f2de00 Mon Sep 17 00:00:00 2001 From: ales stibal Date: Mon, 11 Nov 2024 01:50:36 +0100 Subject: [PATCH] http1 - engine was using too short buffer to detect longer HTTP requests --- src/inspect/engine/http.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/inspect/engine/http.cpp b/src/inspect/engine/http.cpp index 8f04fb6..c99d636 100644 --- a/src/inspect/engine/http.cpp +++ b/src/inspect/engine/http.cpp @@ -21,7 +21,7 @@ namespace sx::engine::http { auto ix_ref = data.find("Referer: "); if (ix_ref != std::string::npos) { - std::string ref_start ( data.substr(ix_ref, std::min(std::size_t(128), data.size() - ix_ref)) ); + std::string ref_start ( data.substr(ix_ref, std::min(std::size_t(1024), data.size() - ix_ref)) ); if (std::regex_search(ref_start, m_ref, ProtoRex::http_req_ref())) { std::string str_temp; @@ -64,7 +64,7 @@ namespace sx::engine::http { return false; }; - std::string host_start( data.substr(ix_host, std::min(std::size_t(128), data.size() - ix_host)) ); + std::string host_start( data.substr(ix_host, std::min(std::size_t(1024), data.size() - ix_host)) ); std::smatch m_host; auto const regex_ret = std::regex_search(host_start, m_host, ProtoRex::http_req_host()); @@ -115,7 +115,7 @@ namespace sx::engine::http { bool find_method (EngineCtx &ctx, std::string_view data) { auto const& log = log::http1; - std::string method_start(data.substr(0, std::min(std::size_t(128), data.size()))); + std::string method_start(data.substr(0, std::min(std::size_t(1024), data.size()))); std::smatch m_get; if (std::regex_search(method_start, m_get, ProtoRex::http_req_get())) {