Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

domain is not parsed correctly for run.app #308

Open
RezaRahmati opened this issue Feb 26, 2023 · 3 comments
Open

domain is not parsed correctly for run.app #308

RezaRahmati opened this issue Feb 26, 2023 · 3 comments

Comments

@RezaRahmati
Copy link

RezaRahmati commented Feb 26, 2023

Steps to reproduce:

const parsed = psl.parse('health-check-tool-2-api-izeboapi4q-nn.a.run.app')
console.log(parsed.domain)

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 domain

from examples on readme

// Parse domain with nested subdomains
var parsed = psl.parse('a.b.c.d.foo.com');
console.log(parsed.tld); // 'com'
console.log(parsed.sld); // 'foo'
console.log(parsed.domain); // 'foo.com'
console.log(parsed.subdomain); // 'a.b.c.d'

Also added a request publicsuffix/list#1710

@RezaRahmati RezaRahmati changed the title domain is not parsed correctly domain is not parsed correctly for run.app Feb 26, 2023
@RezaRahmati RezaRahmati changed the title domain is not parsed correctly for run.app domain is not parsed correctly for run.app Feb 26, 2023
@bobmorley
Copy link

I do not think this is an issue. As per publicsuffix/list#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.

@agustingianni
Copy link

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

@BlackWolfWoof
Copy link

BlackWolfWoof commented Apr 29, 2024

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)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants