-
Notifications
You must be signed in to change notification settings - Fork 8k
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
TrustedProxies: Add default IPv6 support and refactor #2967
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2967 +/- ##
==========================================
+ Coverage 98.57% 98.60% +0.03%
==========================================
Files 41 41
Lines 3085 3084 -1
==========================================
Hits 3041 3041
+ Misses 31 30 -1
Partials 13 13
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Linked issue #2966 by @beanbest Code review plz @thinkerou |
@appleboy code review plz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Engine
fromcontext.go
togin.go
.validateHeader
to decrease Codecov coverage misses.Context.RemoteIP()
:4.1. This is a public function, its usage should be friendly to users.
4.2.
RemoteAddr
is almost impossible to fake. If I wanna get the remote address directly byRemoteIP()
, it's unnecessary to know if trusted. The Trusted Proxies checking should be finished inClientIP()
.Engine.isUnsafeTrustedProxies()
.This PR has passed checks on my side: Bisstocuz#3