Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
fix: fix hostname in verifica esistenza url
Browse files Browse the repository at this point in the history
  • Loading branch information
acattaneoacn committed Nov 10, 2022
1 parent 799b6f8 commit 359f9a3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,7 @@ async function hostnameExists(
throw new Error("Hostname does not exists");
}

let hostname = newURL.hostname;
hostname = hostname.replace(/(^\w+:|^)\/\//, "");
hostname = hostname.replace("www.", "");
hostname = hostname.replace("/", "");
const hostname = newURL.host;

return new Promise((resolve) => {
dns.lookup(hostname, (error) => resolve({ hostname, exists: !error }));
Expand Down

0 comments on commit 359f9a3

Please sign in to comment.