From 3e7aac4f4610995a4dc68aaf2126d7502fac6af6 Mon Sep 17 00:00:00 2001 From: JP Simard Date: Fri, 7 Jan 2022 14:21:52 -0500 Subject: [PATCH] Decompress even when `no-transform` is specified (#1995) Commit Message: Decompress even when `no-transform` is specified Additional Description: This leverages the flag added in https://github.com/envoyproxy/envoy/pull/19399 to always decompress responses, regardless of the presence of a `no-transform` cache control header, matching the more lenient behavior of other client-side networking libraries such as OkHttp or URLSession, especially in cases where the remote server is not under the client developer's control. Risk Level: Low, responses that would previously fail to decode will now succeed when a compressed response comes with a `no-transform` cache control header. Testing: Added unit tests in Envoy and manually confirmed in an Android app that gzipped responses with `no-transform` that previously failed now succeed. Docs Changes: Not needed. Release Notes: Added. Platform Specific Features: This is configured to apply regardless of the platform, so both iOS & Android will get this new behavior. Signed-off-by: JP Simard --- mobile/bazel/apple_test.bzl | 6 ++++-- mobile/docs/root/intro/version_history.rst | 2 ++ mobile/envoy | 2 +- mobile/library/common/config/config.cc | 3 +++ mobile/test/common/integration/BUILD | 4 ++++ mobile/test/swift/integration/BUILD | 4 ++++ 6 files changed, 18 insertions(+), 3 deletions(-) diff --git a/mobile/bazel/apple_test.bzl b/mobile/bazel/apple_test.bzl index e392604b791d..393c30b1f56e 100644 --- a/mobile/bazel/apple_test.bzl +++ b/mobile/bazel/apple_test.bzl @@ -18,7 +18,7 @@ load("@rules_cc//cc:defs.bzl", "objc_library") # ], # ) # -def envoy_mobile_swift_test(name, srcs, data = [], deps = [], repository = ""): +def envoy_mobile_swift_test(name, srcs, data = [], deps = [], tags = [], repository = ""): test_lib_name = name + "_lib" swift_library( name = test_lib_name, @@ -36,9 +36,10 @@ def envoy_mobile_swift_test(name, srcs, data = [], deps = [], repository = ""): data = data, deps = [test_lib_name], minimum_os_version = "11.0", + tags = tags, ) -def envoy_mobile_objc_test(name, srcs, data = [], deps = []): +def envoy_mobile_objc_test(name, srcs, data = [], deps = [], tags = []): test_lib_name = name + "_lib" objc_library( name = test_lib_name, @@ -53,4 +54,5 @@ def envoy_mobile_objc_test(name, srcs, data = [], deps = []): data = data, deps = [test_lib_name], minimum_os_version = "11.0", + tags = tags, ) diff --git a/mobile/docs/root/intro/version_history.rst b/mobile/docs/root/intro/version_history.rst index cf87f2842f98..6cebf3960f95 100644 --- a/mobile/docs/root/intro/version_history.rst +++ b/mobile/docs/root/intro/version_history.rst @@ -6,6 +6,8 @@ Pending Release Bugfixes: +- Decompressor: decompress even when `no-transform` is specified (:issue:`#1995 <1995>`) + Features: 0.4.4 (December 30, 2021) diff --git a/mobile/envoy b/mobile/envoy index 8a75ac104746..fb06327905ef 160000 --- a/mobile/envoy +++ b/mobile/envoy @@ -1 +1 @@ -Subproject commit 8a75ac104746fea9efb4ce7e8155afa49d9ef78d +Subproject commit fb06327905ef28444a6abbbccabcc395de9e0cbc diff --git a/mobile/library/common/config/config.cc b/mobile/library/common/config/config.cc index 52a0cca20f81..6e2ed8cedd7d 100644 --- a/mobile/library/common/config/config.cc +++ b/mobile/library/common/config/config.cc @@ -294,6 +294,9 @@ R"( enabled: default_value: false runtime_key: request_decompressor_enabled + response_direction_config: + common_config: + ignore_no_transform_header: true - name: envoy.router typed_config: "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router diff --git a/mobile/test/common/integration/BUILD b/mobile/test/common/integration/BUILD index 277e316c0ce4..41a218047805 100644 --- a/mobile/test/common/integration/BUILD +++ b/mobile/test/common/integration/BUILD @@ -8,6 +8,10 @@ envoy_cc_test( name = "client_integration_test", srcs = ["client_integration_test.cc"], repository = "@envoy", + # TODO(jpsim): Fix remote execution for these tests + tags = [ + "no-remote-exec", + ], deps = [ "//library/common/extensions/filters/http/local_error:config", "//library/common/extensions/filters/http/local_error:filter_cc_proto", diff --git a/mobile/test/swift/integration/BUILD b/mobile/test/swift/integration/BUILD index 3269f4b4540e..3294c1c0ef86 100644 --- a/mobile/test/swift/integration/BUILD +++ b/mobile/test/swift/integration/BUILD @@ -30,6 +30,10 @@ envoy_mobile_swift_test( "SetLoggerTest.swift", "StatFlushIntegrationTest.swift", ], + # TODO(jpsim): Fix remote execution for these tests + tags = [ + "no-remote-exec", + ], deps = [ ":test_extensions", "//library/objective-c:envoy_engine_objc_lib",