@Test public void canServeOriginalResponseContentEncoding() { test_canServeOriginalResponseContentEncoding(true, "gzip", "gzip"); test_canServeOriginalResponseContentEncoding(true, "gzip", "deflate, gzip;q=1.0, *;q=0.5"); test_canServeOriginalResponseContentEncoding(true, "gzip", "gzip, deflate, br"); test_canServeOriginalResponseContentEncoding(true, "gzip, br", "gzip, deflate, br"); test_canServeOriginalResponseContentEncoding(false, "gzip", null); test_canServeOriginalResponseContentEncoding(false, "gzip", ""); test_canServeOriginalResponseContentEncoding(false, "gzip", "deflate;q=1.0, gzip;q=0.0, *;q=0.5"); test_canServeOriginalResponseContentEncoding(true, null, null); test_canServeOriginalResponseContentEncoding(true, null, ""); test_canServeOriginalResponseContentEncoding(true, "", null); test_canServeOriginalResponseContentEncoding(true, "", ""); test_canServeOriginalResponseContentEncoding(true, "identity", null); test_canServeOriginalResponseContentEncoding(true, null, "gzip, deflate, br"); test_canServeOriginalResponseContentEncoding(true, "", "gzip, deflate, br"); test_canServeOriginalResponseContentEncoding(true, "identity", "gzip, deflate, br"); }
@VisibleForTesting static boolean canServeOriginalResponseContentEncoding(List<String> parsedResponseContentEncodings, @Nullable String acceptEncodingHeaderValue) { List<WeightedEncoding> acceptsWeighted = parseAcceptedEncodings(acceptEncodingHeaderValue); return canServeOriginalResponseContentEncoding(parsedResponseContentEncodings, acceptsWeighted); }
WrappingResponseEncoding implements HarResponseEncoding { @VisibleForTesting static boolean canServeOriginalResponseContentEncoding(List<String> parsedResponseContentEncodings, @Nullable String acceptEncodingHeaderValue) { List<WeightedEncoding> acceptsWeighted = parseAcceptedEncodings(acceptEncodingHeaderValue); return canServeOriginalResponseContentEncoding(parsedResponseContentEncodings, acceptsWeighted); } }
WrappingResponseEncoding implements HarResponseEncoding { @VisibleForTesting static boolean canServeOriginalResponseContentEncoding(List<String> parsedResponseContentEncodings, @Nullable String acceptEncodingHeaderValue) { List<WeightedEncoding> acceptsWeighted = parseAcceptedEncodings(acceptEncodingHeaderValue); return canServeOriginalResponseContentEncoding(parsedResponseContentEncodings, acceptsWeighted); } WrappingResponseEncoding(Iterable<Map.Entry<String, HttpContentCodec>> codecs); }
WrappingResponseEncoding implements HarResponseEncoding { @VisibleForTesting static boolean canServeOriginalResponseContentEncoding(List<String> parsedResponseContentEncodings, @Nullable String acceptEncodingHeaderValue) { List<WeightedEncoding> acceptsWeighted = parseAcceptedEncodings(acceptEncodingHeaderValue); return canServeOriginalResponseContentEncoding(parsedResponseContentEncodings, acceptsWeighted); } WrappingResponseEncoding(Iterable<Map.Entry<String, HttpContentCodec>> codecs); @Override HarResponseData transformUnencoded(HarResponseData unencoded); static HarResponseEncoding fromHeaderValues(@Nullable String contentEncoding, @Nullable String acceptEncoding); }
WrappingResponseEncoding implements HarResponseEncoding { @VisibleForTesting static boolean canServeOriginalResponseContentEncoding(List<String> parsedResponseContentEncodings, @Nullable String acceptEncodingHeaderValue) { List<WeightedEncoding> acceptsWeighted = parseAcceptedEncodings(acceptEncodingHeaderValue); return canServeOriginalResponseContentEncoding(parsedResponseContentEncodings, acceptsWeighted); } WrappingResponseEncoding(Iterable<Map.Entry<String, HttpContentCodec>> codecs); @Override HarResponseData transformUnencoded(HarResponseData unencoded); static HarResponseEncoding fromHeaderValues(@Nullable String contentEncoding, @Nullable String acceptEncoding);  }