From ab477b5631e1a84eebbae1b25a64861d0f19d7ab Mon Sep 17 00:00:00 2001 From: yhirose Date: Thu, 2 Sep 2021 22:57:57 -0400 Subject: [PATCH] Fix "Issue 37742 in oss-fuzz: cpp-httplib:server_fuzzer: Timeout in server_fuzzer" --- httplib.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/httplib.h b/httplib.h index 1ff1bec..ccb18b0 100644 --- a/httplib.h +++ b/httplib.h @@ -3216,8 +3216,7 @@ bool prepare_content_receiver(T &x, int &status, std::string encoding = x.get_header_value("Content-Encoding"); std::unique_ptr decompressor; - if (encoding.find("gzip") != std::string::npos || - encoding.find("deflate") != std::string::npos) { + if (encoding == "gzip" || encoding == "deflate") { #ifdef CPPHTTPLIB_ZLIB_SUPPORT decompressor = detail::make_unique(); #else