From b2a0cc642907d800eb988118edb91d27e5db903f Mon Sep 17 00:00:00 2001 From: PabloMK7 Date: Tue, 3 Oct 2023 13:49:07 +0200 Subject: [PATCH] Revert httplib --- externals/httplib/httplib.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/externals/httplib/httplib.h b/externals/httplib/httplib.h index e75bcc75f4..3657b47946 100644 --- a/externals/httplib/httplib.h +++ b/externals/httplib/httplib.h @@ -3543,16 +3543,7 @@ bool read_content(Stream &strm, T &x, size_t payload_max_length, int &status, inline ssize_t write_headers(Stream &strm, const Headers &headers) { ssize_t write_len = 0; - auto it = headers.find("Host"); - if (it != headers.end()) { - auto len = - strm.write_format("%s: %s\r\n", it->first.c_str(), it->second.c_str()); - if (len < 0) { return len; } - write_len += len; - } for (const auto &x : headers) { - if (x.first == "Host") - continue; auto len = strm.write_format("%s: %s\r\n", x.first.c_str(), x.second.c_str()); if (len < 0) { return len; } @@ -6295,7 +6286,7 @@ inline bool ClientImpl::write_request(Stream &strm, Request &req, // Prepare additional headers if (close_connection) { if (!req.has_header("Connection")) { - //req.headers.emplace("Connection", "close"); + req.headers.emplace("Connection", "close"); } } @@ -6315,7 +6306,7 @@ inline bool ClientImpl::write_request(Stream &strm, Request &req, } } - //if (!req.has_header("Accept")) { req.headers.emplace("Accept", "*/*"); } + if (!req.has_header("Accept")) { req.headers.emplace("Accept", "*/*"); } #ifndef CPPHTTPLIB_NO_DEFAULT_USER_AGENT if (!req.has_header("User-Agent")) { @@ -6340,7 +6331,7 @@ inline bool ClientImpl::write_request(Stream &strm, Request &req, } } else { if (!req.has_header("Content-Type")) { - //req.headers.emplace("Content-Type", "text/plain"); + req.headers.emplace("Content-Type", "text/plain"); } if (!req.has_header("Content-Length")) {