Skip to content

Commit

Permalink
fix: correctly check isOnline with port (#12706)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic authored Dec 10, 2024
1 parent 3169593 commit f6c4214
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/wild-ducks-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/upgrade': patch
---

Fixes a bug that caused registry URLs that specify a port to be incorrectly detected as offline.
4 changes: 2 additions & 2 deletions packages/upgrade/src/actions/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
Expand Down

0 comments on commit f6c4214

Please sign in to comment.