From ee595cae6359110e97bf0dce54a16a98feb042c7 Mon Sep 17 00:00:00 2001 From: yhirose Date: Fri, 5 Dec 2025 15:09:08 -0500 Subject: [PATCH] Update httplib.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- httplib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/httplib.h b/httplib.h index fdd0c3b..2a36618 100644 --- a/httplib.h +++ b/httplib.h @@ -3043,8 +3043,8 @@ inline bool is_weak_etag(const std::string &s) { } inline bool is_strong_etag(const std::string &s) { - // Check if the string is a strong ETag (starts with '"' but not 'W/"') - return !s.empty() && s[0] == '"'; + // Check if the string is a strong ETag (starts and ends with '"', at least 2 chars) + return s.size() >= 2 && s[0] == '"' && s.back() == '"'; } inline size_t to_utf8(int code, char *buff) {