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

net: consider /dns/localhost as private address #221

Merged
merged 2 commits into from
Oct 12, 2023

Conversation

sukunrt
Copy link
Member

@sukunrt sukunrt commented Sep 16, 2023

This fixes IsPrivateAddr check to correctly classify localhost dns addresses as private.

This fixes sub domain check to correctly classify equal domains as sub domains. So /dns/localhost/ is classified as non public. This is similar to https://pkg.go.dev/github.com/miekg/dns#IsSubDomain. I didn't want to import a library for this so I'm using a custom implementation.

net/private.go Outdated Show resolved Hide resolved
@marten-seemann marten-seemann changed the title manet: consider /dns/localhost as private address net: consider /dns/localhost as private address Sep 17, 2023
@marten-seemann marten-seemann merged commit f9a66bc into master Oct 12, 2023
9 checks passed
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.

None yet

2 participants