From fe11f981cf3a87dec8947bb5b4a9ff187e9eb2ea Mon Sep 17 00:00:00 2001 From: Benjamin Simon Date: Wed, 11 Dec 2024 16:31:24 +0100 Subject: [PATCH] fix transformer to not do value replacement on port --- .../testing/snapshots/transformer_utility.py | 6 +++- ...test_apigateway_integrations.snapshot.json | 28 +++++++++---------- ...st_apigateway_integrations.validation.json | 8 +++--- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/localstack-core/localstack/testing/snapshots/transformer_utility.py b/localstack-core/localstack/testing/snapshots/transformer_utility.py index df51596ca1f0f..95bfc0b21cbc2 100644 --- a/localstack-core/localstack/testing/snapshots/transformer_utility.py +++ b/localstack-core/localstack/testing/snapshots/transformer_utility.py @@ -217,7 +217,11 @@ def apigateway_invocation_headers(): ), TransformerUtility.key_value("X-Amzn-Apigateway-Api-Id"), TransformerUtility.key_value("X-Forwarded-For"), - TransformerUtility.key_value("X-Forwarded-Port"), + TransformerUtility.key_value( + "X-Forwarded-Port", + value_replacement="", + reference_replacement=False, + ), TransformerUtility.key_value( "X-Forwarded-Proto", value_replacement="", diff --git a/tests/aws/services/apigateway/test_apigateway_integrations.snapshot.json b/tests/aws/services/apigateway/test_apigateway_integrations.snapshot.json index 9c8acd6361159..821a3a98b8c3b 100644 --- a/tests/aws/services/apigateway/test_apigateway_integrations.snapshot.json +++ b/tests/aws/services/apigateway/test_apigateway_integrations.snapshot.json @@ -436,7 +436,7 @@ } }, "tests/aws/services/apigateway/test_apigateway_integrations.py::TestApiGatewayHeaderRemapping::test_apigateway_header_remapping_http[HTTP]": { - "recorded-date": "17-07-2024, 18:34:51", + "recorded-date": "11-12-2024, 15:28:47", "recorded-content": { "apigw-id": "", "no-param-integration": { @@ -451,7 +451,7 @@ }, "response-headers": { "Connection": "close", - "Content-Length": "463", + "Content-Length": "462", "Content-Type": "application/json", "Date": "", "X-Amzn-Trace-Id": "", @@ -521,7 +521,7 @@ "Age": "response_param_Age", "Connection": "close", "Content-Encoding": "response_param_Content-Encoding", - "Content-Length": "2740", + "Content-Length": "2739", "Content-Type": "response_param_Content-Type", "Date": "", "Pragma": "response_param_Pragma", @@ -580,7 +580,7 @@ } }, "tests/aws/services/apigateway/test_apigateway_integrations.py::TestApiGatewayHeaderRemapping::test_apigateway_header_remapping_http[HTTP_PROXY]": { - "recorded-date": "17-07-2024, 18:35:02", + "recorded-date": "11-12-2024, 15:29:02", "recorded-content": { "apigw-id": "", "no-param-integration": { @@ -607,12 +607,12 @@ "Access-Control-Allow-Credentials": "true", "Access-Control-Allow-Origin": "*", "Connection": "close", - "Content-Length": "791", + "Content-Length": "790", "Content-Type": "application/json", "Date": "", "x-amz-apigw-id": "", "x-amzn-Remapped-Connection": "keep-alive", - "x-amzn-Remapped-Content-Length": "791", + "x-amzn-Remapped-Content-Length": "790", "x-amzn-Remapped-Date": "", "x-amzn-Remapped-Server": "gunicorn/19.9.0", "x-amzn-RequestId": "" @@ -649,12 +649,12 @@ "Access-Control-Allow-Credentials": "true", "Access-Control-Allow-Origin": "*", "Connection": "close", - "Content-Length": "1189", + "Content-Length": "1188", "Content-Type": "application/json", "Date": "", "x-amz-apigw-id": "", "x-amzn-Remapped-Connection": "keep-alive", - "x-amzn-Remapped-Content-Length": "1189", + "x-amzn-Remapped-Content-Length": "1188", "x-amzn-Remapped-Date": "", "x-amzn-Remapped-Server": "gunicorn/19.9.0", "x-amzn-RequestId": "" @@ -691,7 +691,7 @@ } }, "tests/aws/services/apigateway/test_apigateway_integrations.py::TestApiGatewayHeaderRemapping::test_apigateway_header_remapping_aws[AWS]": { - "recorded-date": "18-07-2024, 23:22:48", + "recorded-date": "11-12-2024, 15:29:40", "recorded-content": { "apigw-id": "", "no-param-integration": { @@ -874,7 +874,7 @@ } }, "tests/aws/services/apigateway/test_apigateway_integrations.py::TestApiGatewayHeaderRemapping::test_apigateway_header_remapping_aws[AWS_PROXY]": { - "recorded-date": "18-07-2024, 23:23:10", + "recorded-date": "11-12-2024, 15:29:56", "recorded-content": { "apigw-id": "", "no-param-integration": { @@ -897,12 +897,12 @@ "Warn": "299 localStack/0.0", "X-Amzn-Trace-Id": "", "X-Forwarded-For": "", - "X-Forwarded-Port": "", + "X-Forwarded-Port": "", "X-Forwarded-Proto": "" }, "response-headers": { "Connection": "close", - "Content-Length": "2339", + "Content-Length": "2336", "Content-Type": "application/json", "Date": "", "X-Amzn-Trace-Id": "", @@ -930,12 +930,12 @@ "Warn": "299 localStack/0.0", "X-Amzn-Trace-Id": "", "X-Forwarded-For": "", - "X-Forwarded-Port": "", + "X-Forwarded-Port": "", "X-Forwarded-Proto": "" }, "response-headers": { "Connection": "close", - "Content-Length": "2323", + "Content-Length": "2320", "Content-Type": "application/json", "Date": "", "X-Amzn-Trace-Id": "", diff --git a/tests/aws/services/apigateway/test_apigateway_integrations.validation.json b/tests/aws/services/apigateway/test_apigateway_integrations.validation.json index 9af58354dd52e..9a6dd24061fb0 100644 --- a/tests/aws/services/apigateway/test_apigateway_integrations.validation.json +++ b/tests/aws/services/apigateway/test_apigateway_integrations.validation.json @@ -1,15 +1,15 @@ { "tests/aws/services/apigateway/test_apigateway_integrations.py::TestApiGatewayHeaderRemapping::test_apigateway_header_remapping_aws[AWS]": { - "last_validated_date": "2024-07-18T23:22:46+00:00" + "last_validated_date": "2024-12-11T15:29:38+00:00" }, "tests/aws/services/apigateway/test_apigateway_integrations.py::TestApiGatewayHeaderRemapping::test_apigateway_header_remapping_aws[AWS_PROXY]": { - "last_validated_date": "2024-07-18T23:23:04+00:00" + "last_validated_date": "2024-12-11T15:29:54+00:00" }, "tests/aws/services/apigateway/test_apigateway_integrations.py::TestApiGatewayHeaderRemapping::test_apigateway_header_remapping_http[HTTP]": { - "last_validated_date": "2024-07-17T18:34:51+00:00" + "last_validated_date": "2024-12-11T15:28:46+00:00" }, "tests/aws/services/apigateway/test_apigateway_integrations.py::TestApiGatewayHeaderRemapping::test_apigateway_header_remapping_http[HTTP_PROXY]": { - "last_validated_date": "2024-07-17T18:34:56+00:00" + "last_validated_date": "2024-12-11T15:28:54+00:00" }, "tests/aws/services/apigateway/test_apigateway_integrations.py::test_create_execute_api_vpc_endpoint": { "last_validated_date": "2024-04-15T23:07:07+00:00"