diff --git a/httplib.h b/httplib.h index 89383f6..fc1ac84 100644 --- a/httplib.h +++ b/httplib.h @@ -8458,8 +8458,10 @@ inline bool Server::check_if_not_modified(const Request &req, Response &res, // simplified implementation requires exact matches. auto ret = detail::split_find(val.data(), val.data() + val.size(), ',', [&](const char *b, const char *e) { - auto tag = std::string(b, e); - return tag == "*" || tag == etag; + auto len = static_cast(e - b); + if (len == 1 && *b == '*') return true; + if (len == etag.size() && std::equal(b, e, etag.begin())) return true; + return false; }); if (ret) {