jpillora / go-tld

TLD Parser in Go
MIT License
127 stars 19 forks source link

Hack etld1 for non icann public suffixes #16

Closed raz-amir closed 2 years ago

raz-amir commented 2 years ago

Parsing fails to get etld1 when the input URL matches a non icann address. For example: https://github.io https://myshopify.com It fails with the following error: publicsuffix: cannot derive eTLD+1 for domain "github.com" This failure is expected, given those domains are registered as private suffixes.

The suggested hack handles this so that when it fails, it set etld1 to dom for non icann and only if the returned suffix equals to the dom

raz-amir commented 2 years ago

Hi @jpillora , will appreciate getting your feedback on this. Thanks!

jpillora commented 2 years ago

Merged and tagged v1.2.0

thanks!