Coder Social home page Coder Social logo

Comments (7)

eggyal avatar eggyal commented on June 9, 2024 1

I've taken a quick look and indeed it does appear to fit the bill. Thanks @rushmorem !

from publicsuffix.

eggyal avatar eggyal commented on June 9, 2024

This appears to be what List::parse_dns_name was introduced for, however if the root contains an underscore (or any other byte that's valid in a DNS label but not in a hostname) then the following check causes DnsName::domain to return None which surely is not correct?

if Domain::has_valid_syntax(&root) {

Can we remove this check, please?

from publicsuffix.

eggyal avatar eggyal commented on June 9, 2024

Actually, per #7 (comment):

Some people, myself included, are using this library to validate "registrable" domain names. As such, domain.root() must only return registrable domain names.

Nothing in the standards prevent registries from offering for registration domains containing bytes that are disallowed in hostnames, though I accept as a matter of policy most if not all do impose such a restriction. So whether this check strictly belongs in this library is not so clear.

However, if it is to remain, could we instead add root and suffix methods to DnsName that bypass these checks?

from publicsuffix.

rushmorem avatar rushmorem commented on June 9, 2024

Can we remove this check, please?

@eggyal psl sounds like a better fit for your use case. It's lower level and only checks to see if the input ends with a public suffix. It doesn't try to validate the syntax of the hostname. As a bonus it's much faster, doesn't have any dependencies and it is no_std.

from publicsuffix.

rushmorem avatar rushmorem commented on June 9, 2024

@eggyal Does this API work well for your use case? It should eliminate any false negatives you were having but your feedback here is highly appreciated.

from publicsuffix.

rushmorem avatar rushmorem commented on June 9, 2024

Awesome! Thanks for the feedback.

from publicsuffix.

rushmorem avatar rushmorem commented on June 9, 2024

I believe this is now fixed, both in this crate and in addr where parse_dns_name was moved to.

from publicsuffix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.