mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-25 12:14:41 +00:00
CPPHTTPLIB_NO_DEFAULT_USER_AGENT skips default user agent (#1201)
This commit is contained in:
1 parent
bb00a23116
commit
64d001162b
1 file changed
+2
@@ -6153,9 +6153,11 @@ 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")) {
|
if (!req.has_header("User-Agent")) {
|
||||||
req.headers.emplace("User-Agent", "cpp-httplib/0.10.2");
|
req.headers.emplace("User-Agent", "cpp-httplib/0.10.2");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (req.body.empty()) {
|
if (req.body.empty()) {
|
||||||
if (req.content_provider_) {
|
if (req.content_provider_) {
|
||||||
|
|||||||
Reference in new issue
Block a user