Title: XFF Header Processing Change Breaks Client IP Detection When Using CustomHeaderConfig in Original IP Detection
Description
After implementing support for configuring trusted CIDRs in XFF original IP detection (#31831), Envoy is incorrectly appending the IPs in XFF which is causing issues while determining the original client IP.
The change was intended to add support for evaluating client IP addresses against a list of trusted CIDRs, similar to Nginx's realip module functionality. However, this has resulted in unexpected behavior where an additional value is being appended to the XFF header when forwarding requests to upstream services.
We are suspecting it's because of returning false for skip_xff_appendhere which gets evaluated in HCM here.
Title: XFF Header Processing Change Breaks Client IP Detection When Using CustomHeaderConfig in Original IP Detection
Description
After implementing support for configuring trusted CIDRs in XFF original IP detection (#31831), Envoy is incorrectly appending the IPs in XFF which is causing issues while determining the original client IP.
The change was intended to add support for evaluating client IP addresses against a list of trusted CIDRs, similar to Nginx's
realip
module functionality. However, this has resulted in unexpected behavior where an additional value is being appended to the XFF header when forwarding requests to upstream services.We are suspecting it's because of returning
false
forskip_xff_append
here which gets evaluated in HCM here.With the new version (v1.32.x), we see:
With the old version (v1.30.x), we see:
Repro Steps
Configuration
Request
Send a cURL request with v1.30 and v1.32 like this:
Output
v1.32
v1.30