Skip to content

Commit 447dd8e

Browse files
authored
UNC-99 apigateway accept-encoding header wrong (#13350)
1 parent bfcc671 commit 447dd8e

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

tests/aws/services/apigateway/test_apigateway_http.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ def invoke_api(url: str, method: str) -> dict:
245245
"$..headers.x-amzn-remapped-x-amzn-requestid",
246246
# TODO AWS doesn't seems to add Server to lambda invocation for lambda url
247247
"$..headers.x-amzn-remapped-server",
248+
# The value of Accept-Encoding can change when the zstandard package is present
249+
"$..content.headers.accept-encoding",
248250
]
249251
)
250252
@pytest.mark.skipif(

tests/aws/services/apigateway/test_apigateway_lambda.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,14 @@ def handler(event, context, *args):
5959

6060

6161
@markers.aws.validated
62-
@markers.snapshot.skip_snapshot_verify(paths=CLOUDFRONT_SKIP_HEADERS)
62+
@markers.snapshot.skip_snapshot_verify(
63+
paths=CLOUDFRONT_SKIP_HEADERS
64+
+ [
65+
# The value of Accept-Encoding can change when the zstandard package is present
66+
"$..headers.Accept-Encoding",
67+
"$..multiValueHeaders.Accept-Encoding",
68+
]
69+
)
6370
@markers.snapshot.skip_snapshot_verify(
6471
condition=lambda: not is_next_gen_api(),
6572
paths=[
@@ -1244,7 +1251,14 @@ def _invoke_url(url):
12441251

12451252

12461253
@markers.aws.validated
1247-
@markers.snapshot.skip_snapshot_verify(paths=CLOUDFRONT_SKIP_HEADERS)
1254+
@markers.snapshot.skip_snapshot_verify(
1255+
paths=CLOUDFRONT_SKIP_HEADERS
1256+
+ [
1257+
# The value of Accept-Encoding can change when the zstandard package is present
1258+
"$..content.headers.Accept-Encoding",
1259+
"$..content.multiValueHeaders.Accept-Encoding",
1260+
]
1261+
)
12481262
@markers.snapshot.skip_snapshot_verify(
12491263
condition=lambda: not is_next_gen_api(),
12501264
paths=[

tests/aws/services/lambda_/test_lambda.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,8 @@ def test_lambda_url_non_existing_url(self):
14071407
"$..headers.x-forwarded-for",
14081408
"$..headers.x-amzn-trace-id",
14091409
"$..origin", # TODO: LS Lambda should populate this value for AWS parity
1410+
# The value of Accept-Encoding can change when the zstandard package is present
1411+
"$..headers.accept-encoding",
14101412
]
14111413
)
14121414
@markers.aws.validated
@@ -1440,6 +1442,8 @@ def test_lambda_url_echo_http_fixture_default(
14401442
@markers.snapshot.skip_snapshot_verify(
14411443
paths=[
14421444
"$..content.headers.domain", # TODO: LS Lambda should populate this value for AWS parity
1445+
# The value of Accept-Encoding can change when the zstandard package is present
1446+
"$..headers.accept-encoding",
14431447
"$..origin", # TODO: LS Lambda should populate this value for AWS parity
14441448
]
14451449
)
@@ -1465,6 +1469,8 @@ def test_lambda_url_echo_http_fixture_trim_x_headers(
14651469
@markers.snapshot.skip_snapshot_verify(
14661470
paths=[
14671471
"$..origin", # FIXME: LS does not populate the value
1472+
# The value of Accept-Encoding can change when the zstandard package is present
1473+
"$..headers.accept-encoding",
14681474
]
14691475
)
14701476
def test_lambda_url_form_payload(self, create_echo_http_server, snapshot, aws_client):

0 commit comments

Comments
 (0)