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

add realip middleware #20

Merged
merged 3 commits into from
Jan 22, 2022
Merged

add realip middleware #20

merged 3 commits into from
Jan 22, 2022

Conversation

umputun
Copy link
Member

@umputun umputun commented Jan 20, 2022

This middleware allows setting real remote IP for cases where a reverse proxy (or multiply proxies) alters the original RemoteAddr.

In addition it provides GetIPAddress(r *http.Request) method to get the same "real IP" directly from request

@coveralls
Copy link

coveralls commented Jan 20, 2022

Pull Request Test Coverage Report for Build 1722386312

  • 40 of 44 (90.91%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.4%) to 85.783%

Changes Missing Coverage Covered Lines Changed/Added Lines %
realip.go 40 44 90.91%
Totals Coverage Status
Change from base Build 1662057716: 0.4%
Covered Lines: 537
Relevant Lines: 626

💛 - Coveralls

@umputun
Copy link
Member Author

umputun commented Jan 20, 2022

@paskal can you take a quick look, just in case

@umputun umputun merged commit fe82f24 into master Jan 22, 2022
@umputun umputun deleted the realip branch January 22, 2022 08:38
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.

3 participants