addr-rs / addr

Parse domain names reliably and quickly in Rust
MIT License
51 stars 12 forks source link

has_known_suffix not support #19

Open wensiwei opened 1 year ago

wensiwei commented 1 year ago
Name { full: "aaa-bbb.cccc.lab", suffix: Suffix { bytes: [108, 97, 98], fqdn: false, typ: None } }
let url_check = match parse_domain_name(address) {
    Ok(domain) => {
        println!("{:?}", domain);
        domain.has_known_suffix()
    }
    Err(_) => {
        false
    }
};

I tried to use lab as the domain name suffix and found that the verification was not successful. It is true that lab is not a commonly used domain name suffix. Can I implement a method that supports custom verification suffixes?