Conversation
Parse("[:::]:5000/repo") returned a reference. The name regexp accepts any hex and colons inside the brackets, and "[:::]" is not an IPv6 address.
Signed-off-by: Sasha Mitchell <sash.t.mitchell@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #29 +/- ##
==========================================
- Coverage 84.21% 84.12% -0.09%
==========================================
Files 5 5
Lines 304 315 +11
==========================================
+ Hits 256 265 +9
- Misses 38 39 +1
- Partials 10 11 +1 ☔ 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.
Parse("[:::]:5000/repo")returned a reference and a nil error.[:::::::]:5000/repoand[fd00123123123]:75050/repodid the same. The name regexp accepts any run of hex digits and colons inside the brackets. The grammar calls that an RFC 3986 IPv6 address, and none of those strings is one.[::1]:5000/repo,[2001:db8::1]:5000/repo, and[2001:db8::]:5000/repostill parse. A port is still any run of digits, which is what the grammar spells out. The domain regexp stays a prefilter.DomainRegexpstill matches[fd00123123123]:75050, andParsenow rejects it.go test -count=1 -run 'TestReferenceParse/\[:::'failed on tip withmissing expected error: invalid reference formatand passes after the change.go test .passes. golangci-lint v2 reports no issues.