weppos / publicsuffix-ruby

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

valid domain problem in the new version #114

Closed rdonmez1 closed 8 years ago

rdonmez1 commented 8 years ago

hi,

I'm a user for publixsuffix-ruby. not contributing to development for now.

in the older version (earlier version < 2) , if a domain name has unvalid domainname chars (ex. çış) PublicSuffix.parse() method was returning an error about provided domainname isn't a valid domain name.

PublicSuffix.parse("çarşı.com") ---> parse error. but now in the new version, It doesn't return a parse error.

PublicSuffix.parse("çarşı.com", default_rule: nil, ignore_private: false) ---> no error. I think, my problem is about PublicSuffix Rule.

gam3 commented 8 years ago

It seems that the earlier version was the one that was incorrect.

There is a nice write up on stackoverflow:

http://stackoverflow.com/questions/2180465/can-domain-name-subdomains-have-an-underscore-in-it

And the section of the RFC

https://tools.ietf.org/html/rfc2181#page-13

And here is the lookup for çarşı.gam3.net gam3.net. While host made a hash of the response the bind server was happy to serve up the çarşı.gam3.net CNAME record.

# host çarşı.gam3.net gam3.net

\195\167ar\197\159\196\177.gam3.net is an alias for www.gam3.net.
weppos commented 8 years ago

@rdonmez in addition to what @gam3 said, the version 1.5.3 happily parses the domain.

2.3.1 :001 > PublicSuffix.parse("çarşı.com")
 => #<PublicSuffix::Domain:0x007fb404af80d8 @tld="com", @sld="çarşı", @trd=nil>