fix(apigateway): report the caller's address as sourceIp in HTTP API Lambda events (#8674)

This commit is contained in:
Tyler Webb authored and GitHub committed 2026-11-16 19:45:37 -04:00
1 parent 79c074759d
commit 47466ca6a8
3 files changed
+40 -3

No files matched your search

@@ -3712,7 +3712,7 @@ public class ApiGatewayExecuteController {
ctx.put("domainName", AwsEndpoints.executeApiHost(apiId, arnRegion));
ctx.put("domainPrefix", apiId);
ObjectNode identity = ctx.putObject("identity");
identity.put("sourceIp", "127.0.0.1");
identity.put("sourceIp", routeContext.sourceIp());
identity.put("userAgent", headers.getHeaderString("User-Agent") != null
? headers.getHeaderString("User-Agent") : "");
return event;
@@ -3762,7 +3762,7 @@ public class ApiGatewayExecuteController {
http.put("method", httpMethod);
http.put("path", preservedPath);
http.put("protocol", "HTTP/1.1");
http.put("sourceIp", "127.0.0.1");
http.put("sourceIp", routeContext.sourceIp());
http.put("userAgent", headers.getHeaderString("User-Agent") != null
? headers.getHeaderString("User-Agent") : "");
@@ -4131,7 +4131,7 @@ public class ApiGatewayExecuteController {
http.put("method", httpMethod);
http.put("path", preservedPath);
http.put("protocol", "HTTP/1.1");
http.put("sourceIp", "127.0.0.1");
http.put("sourceIp", routeContext.sourceIp());
http.put("userAgent", headers.getHeaderString("User-Agent") != null
? headers.getHeaderString("User-Agent") : "");