You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Strip proxy headers from SigV4 signing clone (#4670)
When requests arrive through a gateway (e.g. ngrok), `X-Forwarded-*`
headers get signed by SigV4. Then `httputil.ReverseProxy.SetXForwarded()`
rewrites those values, causing AWS to reject with 401 due to signature
mismatch. Strip `X-Forwarded-For`/`Host`/`Proto`, `X-Real-Ip`, and
`Forwarded` (RFC 7239) from the signing clone before computing the
signature.
This regressed in 0791876 ("Bump Go to 1.26.0", #4040) which
refactored the transparent proxy from `httputil.NewSingleHostReverseProxy`
(using `Director`) to `&httputil.ReverseProxy{Rewrite: ...}`. The new
`Rewrite` callback calls `pr.SetXForwarded()`, which injects
`X-Forwarded-*` headers on the outbound request — something the old
`Director`-based approach did not do.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments