mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-12-04 22:08:23 +00:00
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:
1 parent
3091751b5d
commit
4e6226d7af
2 files changed
+27
-5
No files matched your search
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user