Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate entry for X-Forwarded-For header #32039

Merged
merged 2 commits into from
Sep 18, 2023

Conversation

tigrato
Copy link
Contributor

@tigrato tigrato commented Sep 18, 2023

PR #27761 replaced oxy.Forwarder with httputil.ReverseProxy.

The new forwarder based on httputil.ReverseProxy is appending the X-Forwarder-For header values instead of replacing them. This PR fixes that behavior and forces the XFF header to be a single value.

PR #27761 replaced `oxy.Forwarder` with `httputil.ReverseProxy`.
The new forwarder based on `httputil.ReverseProxy` is appending the
`X-Forwarder-For` header values instead of replacing them.
This PR fixes that behavior and forces the XFF header to be a single
value.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
@tigrato tigrato force-pushed the tigrato/fix-duplicated-xff branch from 2673a0a to 4bcd2e8 Compare September 18, 2023 14:09
Co-authored-by: Reed Loden <reed@goteleport.com>
@tigrato tigrato enabled auto-merge September 18, 2023 19:21
@tigrato tigrato added this pull request to the merge queue Sep 18, 2023
Merged via the queue into master with commit f476edd Sep 18, 2023
23 checks passed
@tigrato tigrato deleted the tigrato/fix-duplicated-xff branch September 18, 2023 19:40
@public-teleport-github-review-bot

@tigrato See the table below for backport results.

Branch Result
branch/v14 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants