8000 APIGW: fix AWS_PROXY payload with Custom Domains (#12296) · localstack/localstack@5d463b5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5d463b5

Browse files
authored
APIGW: fix AWS_PROXY payload with Custom Domains (#12296)
1 parent 230914f commit 5d463b5

File tree

2 files changed

+6
-3
lines changed
  • localstack-core/localstack/services/apigateway/next_gen/execute_api

2 files changed

+6
-3
lines changed

localstack-core/localstack/services/apigateway/next_gen/execute_api/handlers/parse.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ def create_context_variables(context: RestApiInvocationContext) -> ContextVariab
134134
domain_prefix = domain_name.split(".")[0]
135135
now = datetime.datetime.now()
136136

137-
# TODO: verify which values needs to explicitly have None set
138137
context_variables = ContextVariables(
139138
accountId=context.account_id,
140139
apiId=context.api_id,

localstack-core/localstack/services/apigateway/next_gen/execute_api/integrations/aws.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,13 @@ def create_lambda_input_event(self, context: RestApiInvocationContext) -> Lambda
518518
invocation_req: InvocationRequest = context.invocation_request
519519
integration_req: IntegrationRequest = context.integration_request
520520

521-
# TODO: binary support of APIGW
522521
body, is_b64_encoded = self._format_body(integration_req["body"])
523522

523+
if context.base_path:
524+
path = context.context_variables["path"]
525+
else:
526+
path = invocation_req["path"]
527+
524528
input_event = LambdaInputEvent(
525529
headers=self._format_headers(dict(integration_req["headers"])),
526530
multiValueHeaders=self._format_headers(
@@ -536,7 +540,7 @@ def create_lambda_input_event(self, context: RestApiInvocationContext) -> Lambda
536540
or None,
537541
pathParameters=invocation_req["path_parameters"] or None,
538542
httpMethod=invocation_req["http_method"],
539-
path=invocation_req["path"],
543+
path=path,
540544
resource=context.resource["path"],
541545
)
542546

0 commit comments

Comments
 (0)
0