Skip to content

Commit 4ef8638

Browse files
authored
Merge pull request #157 from deploystackio/main
Merge pull request #156 from deploystackio/feat/new-deploy
2 parents 7c9d23d + fa23d89 commit 4ef8638

14 files changed

Lines changed: 3098 additions & 839 deletions

File tree

check-links.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,30 @@ const checkLocalFile = (linkPath, filePath) => {
5858
return null; // not a local file
5959
};
6060

61+
// Check if URL is a localhost URL
62+
const isLocalhostUrl = (url) => {
63+
try {
64+
const urlObj = new URL(url);
65+
const hostname = urlObj.hostname.toLowerCase();
66+
67+
// Check for localhost patterns
68+
return hostname === 'localhost' ||
69+
hostname === '127.0.0.1' ||
70+
hostname === '0.0.0.0' ||
71+
hostname.endsWith('.localhost');
72+
} catch (error) {
73+
return false;
74+
}
75+
};
76+
6177
// Check external URL
6278
const checkExternalUrl = async (url) => {
79+
// Check if it's a localhost URL and skip validation
80+
if (isLocalhostUrl(url)) {
81+
console.log(` ➡️ ${url} (localhost - skipped)`);
82+
return true;
83+
}
84+
6385
try {
6486
const response = await fetch(url, {
6587
method: 'HEAD',

0 commit comments

Comments
 (0)