From 08e237bfb33e6730a2b5cc0d83a694617396d571 Mon Sep 17 00:00:00 2001 From: yhirose Date: Fri, 5 Dec 2025 15:12:37 -0500 Subject: [PATCH] Update httplib.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- httplib.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) {