Skip to content

Commit

Permalink
Decompress even when no-transform is specified (#1995)
Browse files Browse the repository at this point in the history
Commit Message: Decompress even when `no-transform` is specified
Additional Description: This leverages the flag added in #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 <jp@jpsim.com>
  • Loading branch information
jpsim committed Nov 29, 2022
1 parent 152da7c commit 0308ca7
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 3 deletions.
6 changes: 4 additions & 2 deletions mobile/bazel/apple_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
)
2 changes: 2 additions & 0 deletions mobile/docs/root/intro/version_history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion mobile/envoy
Submodule envoy updated from 8a75ac to fb0632
3 changes: 3 additions & 0 deletions mobile/library/common/config/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions mobile/test/common/integration/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions mobile/test/swift/integration/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 0308ca7

Please sign in to comment.