Skip to content

Commit ee595ca

Browse files
yhiroseCopilot
andauthored
Update httplib.h
Co-authored-by: Copilot <[email protected]>
1 parent 79a8307 commit ee595ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

httplib.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3043,8 +3043,8 @@ inline bool is_weak_etag(const std::string &s) {
30433043
}
30443044

30453045
inline bool is_strong_etag(const std::string &s) {
3046-
// Check if the string is a strong ETag (starts with '"' but not 'W/"')
3047-
return !s.empty() && s[0] == '"';
3046+
// Check if the string is a strong ETag (starts and ends with '"', at least 2 chars)
3047+
return s.size() >= 2 && s[0] == '"' && s.back() == '"';
30483048
}
30493049

30503050
inline size_t to_utf8(int code, char *buff) {

0 commit comments

Comments
 (0)