From f0683f23019c46c96049547a987868d3c2abdf8a Mon Sep 17 00:00:00 2001 From: yhirose Date: Fri, 25 Oct 2019 13:11:49 -0400 Subject: [PATCH] Fixed build errors --- httplib.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/httplib.h b/httplib.h index f73296a..2f7ea01 100644 --- a/httplib.h +++ b/httplib.h @@ -3144,10 +3144,12 @@ Client::Post(const char *path, const Headers &headers, const std::string &body, req.headers.emplace("Content-Type", content_type); req.body = body; +#ifdef CPPHTTPLIB_ZLIB_SUPPORT if (compress) { if (!detail::compress(req.body)) { return nullptr; } req.headers.emplace("Content-Encoding", "gzip"); } +#endif auto res = std::make_shared(); @@ -3226,10 +3228,12 @@ Client::Put(const char *path, const Headers &headers, const std::string &body, req.headers.emplace("Content-Type", content_type); req.body = body; +#ifdef CPPHTTPLIB_ZLIB_SUPPORT if (compress) { if (!detail::compress(req.body)) { return nullptr; } req.headers.emplace("Content-Encoding", "gzip"); } +#endif auto res = std::make_shared(); @@ -3254,10 +3258,12 @@ Client::Patch(const char *path, const Headers &headers, const std::string &body, req.headers.emplace("Content-Type", content_type); req.body = body; +#ifdef CPPHTTPLIB_ZLIB_SUPPORT if (compress) { if (!detail::compress(req.body)) { return nullptr; } req.headers.emplace("Content-Encoding", "gzip"); } +#endif auto res = std::make_shared();