Match an If-Range date exactly against Last-Modified (#2707)

* Match an If-Range date exactly against Last-Modified

* Shorten the If-Range date comments

---------

Co-authored-by: yhirose <yuji.hirose.bug@gmail.com>
This commit is contained in:
Leng Niuandyhirose authored and GitHub committed 2026-12-03 14:28:25 -05:00
1 parent 3091751b5d
commit 4e6226d7af
2 files changed
+27 -5

No files matched your search

+2 -2
View File
@@ -15651,9 +15651,9 @@ inline bool Server::check_if_range(Request &req, const std::string &etag,
// Weak ETags are not valid for If-Range (RFC 9110 Section 13.1.5)
return false;
} else {
// HTTP-date comparison
// HTTP-date must exactly match Last-Modified (RFC 9110 Section 13.1.5)
auto t = detail::parse_http_date(val);
return (t != static_cast<time_t>(-1) && mtime <= t);
return (t != static_cast<time_t>(-1) && mtime == t);
}
};