Skip to content

Commit 33f6738

Browse files
committed
Fix #1249
1 parent 56d8168 commit 33f6738

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

httplib.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
* Configuration
1313
*/
1414

15+
#define CPPHTTPLIB_VERSION_MAJOR 0
16+
#define CPPHTTPLIB_VERSION_MINOR 10
17+
#define CPPHTTPLIB_VERSION_PATCH 4
18+
1519
#ifndef CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND
1620
#define CPPHTTPLIB_KEEPALIVE_TIMEOUT_SECOND 5
1721
#endif
@@ -6194,7 +6198,11 @@ inline bool ClientImpl::write_request(Stream &strm, Request &req,
61946198

61956199
#ifndef CPPHTTPLIB_NO_DEFAULT_USER_AGENT
61966200
if (!req.has_header("User-Agent")) {
6197-
req.headers.emplace("User-Agent", "cpp-httplib/0.10.4");
6201+
auto agent = "cpp-httplib/" +
6202+
std::to_string(CPPHTTPLIB_VERSION_MAJOR) + "." +
6203+
std::to_string(CPPHTTPLIB_VERSION_MINOR) + "." +
6204+
std::to_string(CPPHTTPLIB_VERSION_PATCH);
6205+
req.headers.emplace("User-Agent", agent);
61986206
}
61996207
#endif
62006208

0 commit comments

Comments
 (0)