vendor : update cpp-httplib to 0.53.1 (#27103)
This commit is contained in:
parent
5f754ea0e2
commit
77140d247c
Vendored
+23
-2
@@ -8,8 +8,8 @@
|
||||
#ifndef CPPHTTPLIB_HTTPLIB_H
|
||||
#define CPPHTTPLIB_HTTPLIB_H
|
||||
|
||||
#define CPPHTTPLIB_VERSION "0.53.0"
|
||||
#define CPPHTTPLIB_VERSION_NUM "0x003500"
|
||||
#define CPPHTTPLIB_VERSION "0.53.1"
|
||||
#define CPPHTTPLIB_VERSION_NUM "0x003501"
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0A00
|
||||
@@ -138,6 +138,18 @@
|
||||
#define CPPHTTPLIB_RANGE_MAX_COUNT 1024
|
||||
#endif
|
||||
|
||||
// std::regex_match's backtracking implementation (most acutely on libstdc++)
|
||||
// recurses roughly once per matched character for quantified patterns such
|
||||
// as "(.*)", so a long enough path can exhaust the calling thread's stack; on
|
||||
// a default ~8MB thread stack that has been observed to take on the order of
|
||||
// a couple thousand characters for a simple pattern. 256 leaves a wide safety
|
||||
// margin below that (well under the 8192-byte request URI limit) while still
|
||||
// fitting any realistic route segment; raise it if a route legitimately needs
|
||||
// longer paths. Regex routes are never applied to paths longer than this.
|
||||
#ifndef CPPHTTPLIB_REGEX_ROUTE_PATH_MAX_LENGTH
|
||||
#define CPPHTTPLIB_REGEX_ROUTE_PATH_MAX_LENGTH 256
|
||||
#endif
|
||||
|
||||
#ifndef CPPHTTPLIB_TCP_NODELAY
|
||||
#define CPPHTTPLIB_TCP_NODELAY false
|
||||
#endif
|
||||
@@ -839,6 +851,15 @@ inline bool parse_url(const std::string &url, UrlComponents &uc) {
|
||||
}
|
||||
|
||||
pos = close + 1;
|
||||
|
||||
// The IPv6 literal is the whole host, so ']' must be followed by a port,
|
||||
// path, query or fragment delimiter (or the end of input). Otherwise the
|
||||
// trailing bytes would be folded into the path while the connection
|
||||
// still targets the bracketed address.
|
||||
if (pos < url.size()) {
|
||||
auto c = url[pos];
|
||||
if (c != ':' && c != '/' && c != '?' && c != '#') { return false; }
|
||||
}
|
||||
} else {
|
||||
auto end = url.find_first_of(":/?#", pos);
|
||||
if (end == std::string::npos) { end = url.size(); }
|
||||
|
||||
Reference in New Issue
Block a user