From 64d001162b68950a47de88969b2fe98631e3767e Mon Sep 17 00:00:00 2001 From: au-ee Date: Tue, 22 Feb 2022 15:39:26 +0100 Subject: [PATCH] CPPHTTPLIB_NO_DEFAULT_USER_AGENT skips default user agent (#1201) --- httplib.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/httplib.h b/httplib.h index 42e4d57..19df36b 100644 --- a/httplib.h +++ b/httplib.h @@ -6153,9 +6153,11 @@ inline bool ClientImpl::write_request(Stream &strm, Request &req, if (!req.has_header("Accept")) { req.headers.emplace("Accept", "*/*"); } +#ifndef CPPHTTPLIB_NO_DEFAULT_USER_AGENT if (!req.has_header("User-Agent")) { req.headers.emplace("User-Agent", "cpp-httplib/0.10.2"); } +#endif if (req.body.empty()) { if (req.content_provider_) {