TrustedProxies: Add default IPv6 support and refactor#2967
Merged
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.
|
Contributor
Author
|
Linked issue #2966 by @beanbest Code review plz @thinkerou |
thinkerou
reviewed
Nov 29, 2021
thinkerou
reviewed
Nov 29, 2021
Contributor
Author
|
@appleboy code review plz |
appleboy
approved these changes
Dec 3, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enginefromcontext.gotogin.go.validateHeaderto decrease Codecov coverage misses.Context.RemoteIP():4.1. This is a public function, its usage should be friendly to users.
4.2.
RemoteAddris 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