From: Eric Zhang Date: Sun, 31 May 2026 21:21:08 +0000 (+0800) Subject: server : handle If-None-Match weak ETags (#23916) X-Git-Tag: upstream/0.0.10438~994 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=6f165c1c64f77024686dc969c3de6f030f274add;p=pkg%2Fggml%2Fsources%2Fllama.cpp server : handle If-None-Match weak ETags (#23916) --- diff --git a/tools/server/server-http.cpp b/tools/server/server-http.cpp index 3616b3b4d..34a20c9d2 100644 --- a/tools/server/server-http.cpp +++ b/tools/server/server-http.cpp @@ -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; }