0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

fix: correctly check isOnline with port (#12706)

This commit is contained in:
Matt Kane 2024-12-10 20:00:58 +00:00 committed by GitHub
parent 316959355c
commit f6c4214042
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/upgrade': patch
---
Fixes a bug that caused registry URLs that specify a port to be incorrectly detected as offline.

View file

@ -43,8 +43,8 @@ export async function verify(
}
function isOnline(registry: string): Promise<boolean> {
const { host } = new URL(registry);
return dns.lookup(host).then(
const { hostname } = new URL(registry);
return dns.lookup(hostname).then(
() => true,
() => false,
);