Open RezaRahmati opened 1 year ago
I do not think this is an issue. As per https://github.com/publicsuffix/list/issues/1710 run.app is already on the list.
Moreover, a.run.app
is also a TLD on the list; so the actual result here is correct.
I think I'm having a similar issue:
console.log(psl.parse('s3.eu-central-1.amazonaws.com'))
Gives me:
input: "s3.eu-central-1.amazonaws.com"
tld: "s3.eu-central-1.amazonaws.com"
sld: null
domain: null
subdomain: null
listed: true
I am having the same issue with altervista.org which is also on the list. Why? It isn't even a TLD
Lil fix on my end to deal with this😹
import psl from 'psl';
const url = "https://altervista.org"
let domain = new URL(url).host
let domainParse = psl.parse(domain);
let rootDomain = domainParse.domain || domainParse.tld
console.log('domain: ' + domain)
console.log(domainParse)
console.log('rootDomain: ' + rootDomain)
Hi @RezaRahmati, @agustingianni and @BlackWolfWoof :wave: Many apologies for the delay in getting back to you.
Please note that psl
is not a standard domain name parser, but rather a tool to check against the Public Suffix List. The parsed object property names can be confusing as in the context of the public suffix list, the tld
here would actually mean the publicSuffix
. So this is the expected behaviour. Now that *.run.app
is in the official list, the result is as follows:
psl.parse('health-check-tool-2-api-izeboapi4q-nn.a.run.app')
Return value:
{
input: 'health-check-tool-2-api-izeboapi4q-nn.a.run.app',
tld: 'a.run.app',
sld: 'health-check-tool-2-api-izeboapi4q-nn',
domain: 'health-check-tool-2-api-izeboapi4q-nn.a.run.app',
subdomain: null,
listed: true
}
I'm actually considering adding new props or renaming existing ones in the parsed object to avoid this confusion (happens often). Thanks for all the feedback.
Steps to reproduce:
expected:
run.app
actual:
health-check-tool-2-api-izeboapi4q-nn.a.run.app
version: "psl": "^1.9.0",
p.s
app.run
is the default google cloud run domainfrom examples on readme
Also added a request https://github.com/publicsuffix/list/issues/1710