Skip to content

Commit df84473

Browse files
Merge pull request #153 from UmbrellaDocs/chore-deps-feb-2026
chore: update dependencies, fix flaky redirect test
2 parents 035a538 + ce98978 commit df84473

3 files changed

Lines changed: 786 additions & 1024 deletions

File tree

lib/batch-check-links.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,16 @@ async function processLink(
5656
statusCode = originalStatusCode !== 0 ? originalStatusCode : statusCode
5757
} else if (aliveStatusCodes && aliveStatusCodes.includes(statusCode)) {
5858
status = 'assumed alive'
59+
} else if (statusCode === 304) {
60+
status = 'alive'
61+
if (redirectChain.length > 0) {
62+
errorMessage = `redirected to ${response.url()}`
63+
}
5964
} else {
6065
status = response.ok() ? 'alive' : 'error'
66+
if (status === 'alive' && redirectChain.length > 0) {
67+
errorMessage = `redirected to ${response.url()}`
68+
}
6169
}
6270
}
6371
} catch (error) {
@@ -118,7 +126,7 @@ async function checkHyperlinks(nodes, options = {}, filePath) {
118126
continue
119127
}
120128

121-
if (response.ok) {
129+
if (response.ok || statusCode === 304) {
122130
message = response.redirected ? `redirected to ${response.url}` : null
123131
const linkStatus = createLinkStatus(
124132
link,

0 commit comments

Comments
 (0)