mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
fix(apigw-v2): populate pathParameters in Lambda proxy event for HTTP API integrations (#1067)
* fix(apigw-v2): populate pathParameters in Lambda proxy event for HTTP API integrations
buildV2ProxyEvent never called extractV2PathParams, so pathParameters was always
absent from the Lambda event payload. Frameworks that rely on it for routing (e.g.
the tRPC AWS Lambda adapter via ANY /{proxy+}) failed with path routing errors.
Wire extractV2PathParams into buildV2ProxyEvent after the queryStringParameters
block, mirroring how dispatchHttpProxyV2 already uses it. Also relax the method
visibility to package-private to allow the new unit tests to call it directly.
* test(ec2): scope Ec2NetworkInterfacePaginationTest to its own VPC
DescribeNetworkInterfaces was called without a filter, so the tests
counted ENIs created by other concurrently-running sdk-test-java tests
(e.g. sdk-test-instance from Ec2DescribeNetworkInterfacesTest), causing
intermittent failures when test ordering meant those ENIs existed at
assertion time.
Adds a vpc-id filter helper scoped to the VPC created in @BeforeAll so
each test only sees the 6 ENIs it owns.
This commit is contained in:
1 parent
9d1e24a582
commit
f8a2f2d5c4
3 files changed
+97
-23
No files matched your search
+7
-1
@@ -1734,7 +1734,7 @@ public class ApiGatewayExecuteController {
|
||||
};
|
||||
}
|
||||
|
||||
private String buildV2ProxyEvent(String httpMethod, String path, String routeKey,
|
||||
String buildV2ProxyEvent(String httpMethod, String path, String routeKey,
|
||||
String apiId, String stageName,
|
||||
HttpHeaders headers, UriInfo uriInfo,
|
||||
byte[] body, String requestId) {
|
||||
@@ -1759,6 +1759,12 @@ public class ApiGatewayExecuteController {
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, String> pathParams = extractV2PathParams(routeKey, path);
|
||||
if (!pathParams.isEmpty()) {
|
||||
ObjectNode pp = event.putObject("pathParameters");
|
||||
pathParams.forEach(pp::put);
|
||||
}
|
||||
|
||||
ObjectNode ctx = event.putObject("requestContext");
|
||||
ctx.put("accountId", regionResolver.getAccountId());
|
||||
ctx.put("apiId", apiId);
|
||||
|
||||
Reference in new issue
Block a user