We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c09a665 commit 1316994Copy full SHA for 1316994
src/middleware/extractClientIp.ts
@@ -41,5 +41,7 @@ function extractClientIpFromRequestHeaders(
41
* Only consider last IP as the source of truth as it has been added by AWS ECS Load balancer
42
* See https://docs.aws.amazon.com/elasticloadbalancing/latest/application/x-forwarded-headers.html#x-forwarded-for-append
43
*/
44
- return xForwardedForHeader.split(",").at(-1) ?? FALLBACK_CLIENT_IP_ADDRESS;
+ return (
45
+ xForwardedForHeader.split(",").at(-1)?.trim() ?? FALLBACK_CLIENT_IP_ADDRESS
46
+ );
47
}
0 commit comments