yhirose 9 月之前
父節點
當前提交
61893a00a4
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      httplib.h

+ 3 - 1
httplib.h

@@ -2066,7 +2066,9 @@ template <size_t N> inline constexpr size_t str_len(const char (&)[N]) {
 }
 
 inline bool is_numeric(const std::string &str) {
-  return !str.empty() && std::all_of(str.begin(), str.end(), ::isdigit);
+  return !str.empty() &&
+         std::all_of(str.cbegin(), str.cend(),
+                     [](unsigned char c) { return std::isdigit(c); });
 }
 
 inline uint64_t get_header_value_u64(const Headers &headers,