Skip to content
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

Fix ParseHostOrURL and enable expect tests #2772

Merged
merged 3 commits into from
Aug 19, 2021

Conversation

algorandskiy
Copy link
Contributor

Summary

  • ParseHostOrURL does not accepts ":xxx:123" anymore
  • pingpongTest.exp is still disabled

Test Plan

Added new test cases for ParseHostOrURL: disallow ":xxx:123" and allow "::11.22.33.44:123"

* ParseHostOrURL does not accepts ":xxx:123" anymore
* pingpongTest.exp is still disabled
brianolson
brianolson previously approved these changes Aug 19, 2021
// 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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please define this as a global public error object and use it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@codecov-commenter
Copy link

codecov-commenter commented Aug 19, 2021

Codecov Report

Merging #2772 (37495da) into master (66e54d9) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
network/wsNetwork.go 61.09% <100.00%> (+0.16%) ⬆️
ledger/roundlru.go 90.56% <0.00%> (-5.67%) ⬇️
catchup/service.go 68.57% <0.00%> (-0.78%) ⬇️
ledger/acctupdates.go 61.80% <0.00%> (-0.67%) ⬇️
network/wsPeer.go 75.20% <0.00%> (+0.83%) ⬆️
cmd/tealdbg/debugger.go 73.86% <0.00%> (+1.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 66e54d9...37495da. Read the comment docs.

Copy link
Contributor

@shiqizng shiqizng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants