Skip to content

Commit d7b906a

Browse files
Merge pull request #54 from justindhillon/false-positives
Fix some false positives
2 parents 4355255 + 0f32b87 commit d7b906a

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

checkLink.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,13 @@ export async function checkLink(link: string): Promise<boolean> {
2020
try {
2121
await axios.head(link, params);
2222
} catch (err: any) {
23-
// Forbidden still means alive
24-
if (err.response.status === 403) return false;
25-
2623
// If HEAD is not allowed try GET
27-
if (err.response.status !== 405) return true;
28-
try {
29-
await axios.get(link, params);
30-
} catch {
31-
return true;
24+
if (err.response.status === 405) {
25+
try {
26+
await axios.get(link, params);
27+
} catch {
28+
return true;
29+
}
3230
}
3331
}
3432

0 commit comments

Comments
 (0)