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

support ip chain without spaces in xForwarded header #684

Merged
merged 1 commit into from
Dec 2, 2021
Merged

support ip chain without spaces in xForwarded header #684

merged 1 commit into from
Dec 2, 2021

Conversation

evgenyKharitonov
Copy link
Contributor

This change covers a use case in RealIP middleware, when the chained IPs in X-Forwarded-For header are without space after comma.
This change is backwards compatible.
Test updated to cover this use case as well.

@pkieltyka
Copy link
Member

lol great catch, I dont know how we didnt catch it sooner. Should we also add a strings.Trim() anywhere..?

@evgenyKharitonov
Copy link
Contributor Author

I don't think so, since it's getting the first IP in the chain.

@pkieltyka pkieltyka merged commit e4fe258 into go-chi:master Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants