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

forbid empty multiaddrs #105

Merged
merged 2 commits into from
May 20, 2019
Merged

forbid empty multiaddrs #105

merged 2 commits into from
May 20, 2019

Conversation

Stebalien
Copy link
Member

fixes #104

@Stebalien Stebalien requested a review from hsanjuan May 20, 2019 19:24
@@ -582,11 +582,11 @@ func TestBinaryMarshaler(t *testing.T) {
t.Fatal(err)
}

addr2 := newMultiaddr(t, "")
var addr2 multiaddr
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the issue I was talking about. This could be done by manually calling NewMultiaddr before but now one needs to construct a valid multiaddr.

Copy link
Contributor

Choose a reason for hiding this comment

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

but would work by creating a non-empty multiaddress (which just will be replaced) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I guess. Although... multiaddrs are really supposed to be immutable. I guess this is just an unavoidable edge-case.

@Stebalien Stebalien marked this pull request as ready for review May 20, 2019 19:29
@Stebalien Stebalien merged commit 5b1de2f into master May 20, 2019
@Stebalien Stebalien deleted the feat/no-empty-multiadd branch May 20, 2019 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reject empty multiaddrs
2 participants