Repository navigation
Conversation
A client connecting over a link-local IPv6 address gets a RemoteAddr such as "[fe80::1%eth0]:1234". RemoteIP keeps the zone and net.ParseIP rejects it, so ClientIP returned an empty string and never looked at the forwarding headers. Drop the zone before parsing.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4922 +/- ##
==========================================
+ Coverage 98.65% 98.71% +0.06%
==========================================
Files 48 48
Lines 3188 3189 +1
==========================================
+ Hits 3145 3148 +3
+ Misses 43 41 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
When a client connects over a link-local IPv6 address,
Request.RemoteAddrcarries the zone, e.g.[fe80::1%eth0]:1234.RemoteIP()keeps the zone andnet.ParseIPrejects it, soClientIP()returns""and never looks at X-Forwarded-For / X-Real-IP, even when the peer is a trusted proxy.This drops the zone before parsing.
RemoteIP()is unchanged. Added a test for a trusted link-local proxy (header used) and for no trusted proxies (fe80::1returned).masterbranch.docs/doc.md.