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

ValidateAddress should return true if IPv6 is valid #3027

Merged
merged 1 commit into from Feb 19, 2019

Conversation

jarifibrahim
Copy link
Contributor

@jarifibrahim jarifibrahim commented Feb 17, 2019

  • Add tests for ValidateAddress function

Fixes #3023


This change is Reviewable

- Add tests for ValidateAddress function

Fixes dgraph-io#3023

Signed-off-by: Ibrahim Jarif <jarifibrahim@gmail.com>
x/x.go Show resolved Hide resolved
x/x_test.go Show resolved Hide resolved
Copy link
Contributor

@martinmr martinmr left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @jarifibrahim)


x/x.go, line 282 at r1 (raw file):

Previously, jarifibrahim (Ibrahim Jarif) wrote…

ParseIP returns nil if the IP address is invalid. See https://golang.org/pkg/net/#ParseIP

Ok.


x/x_test.go, line 68 at r1 (raw file):

Previously, jarifibrahim (Ibrahim Jarif) wrote…

I am not sure if this test should return true. Is this the intended behaviour?
A similar test on IPv6 returns false (see https://github.com/dgraph-io/dgraph/pull/3027/files#diff-12d9d50e4e8f838a59b4ad0e7ad05251R87)

I think it's fine for now. We could try to validate the hostname but that would most likely involve importing a library to do it and it's a bit overkill.

@martinmr martinmr merged commit 97ddc70 into dgraph-io:master Feb 19, 2019
@jarifibrahim jarifibrahim deleted the ipv6-crash-3023 branch February 20, 2019 01:25
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 19, 2019
- Add tests for ValidateAddress function

Fixes dgraph-io#3023

Signed-off-by: Ibrahim Jarif <jarifibrahim@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants