mirror of
https://github.com/yhirose/cpp-httplib
synced 2024-11-21 06:26:02 -07:00
CPPHTTPLIB_NO_DEFAULT_USER_AGENT skips default user agent (#1201)
This commit is contained in:
parent
bb00a23116
commit
64d001162b
1 changed files with 2 additions and 0 deletions
|
@ -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_) {
|
||||
|
|
Loading…
Reference in a new issue