tld.js
tld.js copied to clipboard
can not get domain if domain with underscore (_)
e.g. http://wt_nbshentong.cn.b2b168.com/ can not get the domain.
{ hostname: 'wt_njxinjiyuan1.cn.b2b168.com', isValid: false, isIp: false, tldExists: false, publicSuffix: null, domain: null, subdomain: null }
do you know why?
Hi @henryhuang2013,
The issue is that unfortunately tld.js
is rejecting this hostname as invalid because of the _
(underscore) character it contains. There was some work in the past to add an option to still accept such domains but it was not pursued: https://github.com/oncletom/tld.js/pull/122
Best,