Comments (7)
I've taken a quick look and indeed it does appear to fit the bill. Thanks @rushmorem !
from publicsuffix.
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?
Line 537 in 149e9fd
Can we remove this check, please?
from publicsuffix.
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.
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.
@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.
Awesome! Thanks for the feedback.
from publicsuffix.
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)
- OpenSSL requirement is onerous (use native TLS instead) HOT 3
- Question: Single label domain and suffix HOT 2
- Static lists HOT 4
- Improving performance of your publicsuffix library? HOT 53
- 1.5.2 release HOT 1
- Provide alternate tls implementation options HOT 1
- Please support accessing an offline version of the list HOT 8
- Trivial case does not parse correctly HOT 1
- Exclusion rules are not implemented correctly HOT 1
- Why is domain that has a suffix that is not on the list returns true in `has_known_suffix` function?
- Clarify relationship with addr-rs HOT 2
- Add a feature flag to disable from_url, fetch and their dependancies
- `has_known_suffix` always return true HOT 2
- If local-part is missing parse_email() validates successfully HOT 1
- Patch release 1.5.5 has a breaking change HOT 2
- Document caching strategies
- [noise] any feedback about rspec ? HOT 2
- Support for invalid hostnames, e.g., in DNS HOT 1
- Inconsistent handling of trailing dots can lead to panic HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from publicsuffix.