Fix ParseHostOrURL and enable expect tests#2772
Merged
Merged
Conversation
* ParseHostOrURL does not accepts ":xxx:123" anymore * pingpongTest.exp is still disabled
brianolson
previously approved these changes
Aug 19, 2021
62211b0 to
37495da
Compare
| // https://datatracker.ietf.org/doc/html/rfc1123#section-2 | ||
| // first character is relaxed to allow either a letter or a digit | ||
| if parsed.Host[0] == ':' && (len(parsed.Host) < 2 || parsed.Host[1] != ':') { | ||
| return nil, errors.New("host name starts with colon") |
Contributor
There was a problem hiding this comment.
please define this as a global public error object and use it here.
Codecov Report
@@ Coverage Diff @@
## master #2772 +/- ##
==========================================
- Coverage 47.12% 47.10% -0.02%
==========================================
Files 349 349
Lines 56326 56328 +2
==========================================
- Hits 26541 26535 -6
- Misses 26814 26820 +6
- Partials 2971 2973 +2
Continue to review full report at Codecov.
|
Merged
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.
Summary
Test Plan
Added new test cases for ParseHostOrURL: disallow ":xxx:123" and allow "::11.22.33.44:123"