Skip to content

Commit 08e237b

Browse files
yhiroseCopilot
andauthored
Update httplib.h
Co-authored-by: Copilot <[email protected]>
1 parent 27e19a0 commit 08e237b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

httplib.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8458,8 +8458,10 @@ inline bool Server::check_if_not_modified(const Request &req, Response &res,
84588458
// simplified implementation requires exact matches.
84598459
auto ret = detail::split_find(val.data(), val.data() + val.size(), ',',
84608460
[&](const char *b, const char *e) {
8461-
auto tag = std::string(b, e);
8462-
return tag == "*" || tag == etag;
8461+
auto len = static_cast<size_t>(e - b);
8462+
if (len == 1 && *b == '*') return true;
8463+
if (len == etag.size() && std::equal(b, e, etag.begin())) return true;
8464+
return false;
84638465
});
84648466

84658467
if (ret) {

0 commit comments

Comments
 (0)