server : handle If-None-Match weak ETags (#23916)

This commit is contained in:
Eric Zhang
2026-06-01 05:21:08 +08:00
committed by GitHub
parent 399739d5c5
commit 6f165c1c64
+1 -1
View File
@@ -325,7 +325,7 @@ bool server_http_context::init(const common_params & params) {
res.set_header("ETag", a->etag);
// Check If-None-Match for conditional GET (304 Not Modified)
if (const std::string & inm = req.get_header_value("If-None-Match");
!inm.empty() && inm == a->etag) {
!inm.empty() && (inm == a->etag || inm == std::string("W/") + a->etag)) {
res.status = 304;
return false;
}