weppos / publicsuffix-ruby

Domain name parser for Ruby based on the Public Suffix List.
https://simonecarletti.com/code/publicsuffix
MIT License
619 stars 109 forks source link

PublicSuffix::DomainNotAllowed when parse third-level domain #331

Closed rokkit closed 2 months ago

rokkit commented 2 months ago

When I try to parse domain from data/list.txt I have error.

PublicSuffix.parse("vic.gov.au").domain

`vic.gov.au` is not allowed according to Registry policy (PublicSuffix::DomainNotAllowed)

I think this is misbehavior in PublicSuffix::Rule::Normal#decompose due regexp not matches three level domains

Tested on 6.0.1 version of gem

weppos commented 2 months ago

This is expected, because the name is in the list. https://github.com/weppos/publicsuffix-ruby/blob/5297f28b40068510a2b4667d8dbd1e544a7ad03e/data/list.txt#L272