Skip to content

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

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adam-p
Copy link

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

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
Copy link
Author

adam-p commented Mar 27, 2022

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

@amustaque97
Copy link

@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
Contributor

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

# for free to join this conversation on GitHub. Already have an account? # 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