MINOR: cache: Do not store responses with an unknown encoding
If a server varies on the accept-encoding header and it sends a response
with an encoding we do not know (see parse_encoding_value function), we
will not store it. This will prevent unexpected errors caused by
cache collisions that could happen in accept_encoding_hash_cmp.
diff --git a/reg-tests/cache/vary_accept_encoding.vtc b/reg-tests/cache/vary_accept_encoding.vtc
index 59e819a..185ad05 100644
--- a/reg-tests/cache/vary_accept_encoding.vtc
+++ b/reg-tests/cache/vary_accept_encoding.vtc
@@ -292,6 +292,7 @@
#
# Unknown content-encoding
+ # The response should not be cached since it has an unknown content encoding
#
txreq -url "/unknown-content-encoding" -hdr "Accept-Encoding: gzip;q=0.8, deflate, first_encoding"
rxresp
@@ -305,14 +306,6 @@
expect resp.status == 200
expect resp.http.content-encoding == "unknown_encoding"
expect resp.bodylen == 119
- expect resp.http.X-Cache-Hit == 1
-
- # Different set of accepted encodings
- txreq -url "/unknown-content-encoding" -hdr "Accept-Encoding: deflate, first_encoding"
- rxresp
- expect resp.status == 200
- expect resp.http.content-encoding == "unknown_encoding"
- expect resp.bodylen == 119
expect resp.http.X-Cache-Hit == 0
#