fixing cacheable_response? to exclude headers and freshness

it's called with a fresh response already
This commit is contained in:
HoneyryderChuck 2025-04-10 18:39:47 +01:00
parent 0d23c464f5
commit 6bd3c15384

View File

@ -34,9 +34,7 @@ module HTTPX
# directive prohibits caching. However, a cache that does not support
# the Range and Content-Range headers MUST NOT cache 206 (Partial
# Content) responses.
response.status != 206 && (
response.headers.key?("etag") || response.headers.key?("last-modified") || response.fresh?
)
response.status != 206
end
def cached_response?(response)