mirror of
https://github.com/felixrieseberg/windows95.git
synced 2026-05-09 00:24:09 +00:00
check-links: allow 403 from github user-attachments CDN
This commit is contained in:
@@ -15,9 +15,13 @@ async function main() {
|
||||
const response = await fetch(link, { method: 'HEAD' })
|
||||
|
||||
if (!response.ok) {
|
||||
// If we're inside GitHub's release asset server, we just ran into AWS not allowing
|
||||
// HEAD requests, which is different from a 404.
|
||||
if (!response.url.startsWith('https://github-production-release-asset')) {
|
||||
// GitHub's release-asset and user-attachments CDNs reject anonymous HEAD
|
||||
// requests (403), which is different from a 404.
|
||||
const isGithubCdn =
|
||||
response.url.startsWith('https://github-production-release-asset') ||
|
||||
response.url.startsWith('https://github-production-user-asset') ||
|
||||
link.startsWith('https://github.com/user-attachments/')
|
||||
if (!isGithubCdn) {
|
||||
throw new Error (`HTTP Error Response: ${response.status} ${response.statusText}`)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user