Fix #1249
This commit is contained in:
parent
56d8168dc4
commit
33f67386fe
10
httplib.h
10
httplib.h
@ -12,6 +12,10 @@
|
|||||||
* Configuration
|
* Configuration
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define CPPHTTPLIB_VERSION_MAJOR 0
|
||||||
|
#define CPPHTTPLIB_VERSION_MINOR 10
|
||||||
|
#define CPPHTTPLIB_VERSION_PATCH 4
|
||||||
|
|
||||||
#ifndef CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND
|
#ifndef CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND
|
||||||
#define CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND 5
|
#define CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND 5
|
||||||
#endif
|
#endif
|
||||||
@ -6194,7 +6198,11 @@ inline bool ClientImpl::write_request(Stream &strm, Request &req,
|
|||||||
|
|
||||||
#ifndef CPPHTTPLIB_NO_DEFAULT_USER_AGENT
|
#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.4");
|
auto agent = "cpp-httplib/" +
|
||||||
|
std::to_string(CPPHTTPLIB_VERSION_MAJOR) + "." +
|
||||||
|
std::to_string(CPPHTTPLIB_VERSION_MINOR) + "." +
|
||||||
|
std::to_string(CPPHTTPLIB_VERSION_PATCH);
|
||||||
|
req.headers.emplace("User-Agent", agent);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user