3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-06 18:47:20 +00:00

remove trailing dot from FQDN for TLD check

Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
Tiago R 2023-11-26 12:04:39 +00:00 committed by GitHub
parent 047ab872df
commit 9dce492de4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -647,7 +647,9 @@ export function getUrlsInString(str: string, onlyUnique = false): MatchedURL[] {
return urls;
}
const hostnameParts = matchUrl.hostname.split(".");
const hostname = matchUrl.hostname.endsWith(".") ? matchUrl.hostname.slice(0, -1) : matchUrl.hostname;
const hostnameParts = hostname.split(".");
const tld = hostnameParts[hostnameParts.length - 1];
if (tlds.includes(tld)) {
urls.push(matchUrl);