Skip to content

Fix whitespace handling in X-Forwarded-For header parsing#228

Open
adam-p wants to merge 1 commit into
gorilla:mainfrom
adam-p:xff-fix
Open

Fix whitespace handling in X-Forwarded-For header parsing#228
adam-p wants to merge 1 commit into
gorilla:mainfrom
adam-p:xff-fix

Conversation

@adam-p

@adam-p adam-p commented Mar 27, 2022

Copy link
Copy Markdown

Fixes #227

Summary of Changes

  1. Split X-Forwarded-For using space rather than comma-space.
  2. Trim whitespace from resulting value.
  3. Add tests. (Including for Forwarded parsing, which didn't have this problem.)

@adam-p

adam-p commented Mar 27, 2022

Copy link
Copy Markdown
Author

I don't know how to interpret the CircleCI failure.

@amustaque97

Copy link
Copy Markdown

@adam-p thank you for working on this. In order to fix the pipeline issue. You need to add line //go:build go1.8 at the top of the file handlers_go18_test.go in the project.

@coreydaley

Copy link
Copy Markdown

@adam-p If you would resolve the conflict with this pull request we can get it reviewed and merged. Thanks!

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

Labels

None yet

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

[bug] ProxyHeaders XFF parsing handles whitespace incorrectly

3 participants