LibHTTP: Do not respond to Range requests with cached full responses

If we have the response for a non-Range request in the memory cache, we
would previously use it in reply to Range requests. Similar to commit
878b00ae61f998a26aad7f50fae66cf969878ad6, we are just punting on Range
requests in the HTTP caches for now.
This commit is contained in:
Timothy Flynn
2026-01-09 13:15:54 -05:00
committed by Tim Flynn
parent b35645523c
commit 453764d3f0
Notes: github-actions[bot] 2026-01-10 14:03:35 +00:00
4 changed files with 70 additions and 0 deletions

View File

@@ -21,6 +21,9 @@ Optional<MemoryCache::Entry const&> MemoryCache::open_entry(URL::URL const& url,
// When presented with a request, a cache MUST NOT reuse a stored response unless:
// - the presented target URI (Section 7.1 of [HTTP]) and that of the stored response match, and
// - the request method associated with the stored response allows it to be used for the presented request, and
if (!is_cacheable(method, request_headers))
return {};
auto serialized_url = serialize_url_for_cache_storage(url);
auto cache_key = create_cache_key(serialized_url, method);