Skip to content

Commit

Permalink
fetch with head
Browse files Browse the repository at this point in the history
  • Loading branch information
jstet committed Jan 6, 2025
1 parent 79a3a3d commit 3abf44b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions replace_urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ const addJitter = (baseDelay) => {
async function validateUrl(url, retryCount = 0) {
try {
const controller = new AbortController();
const timeout = setTimeout(() => controller.abort(), 10000);
const timeout = setTimeout(() => controller.abort(), 5000); // Reduced timeout for HEAD request

const response = await fetch(url, {
method: 'HEAD',
headers: {
'User-Agent': `CorrelAidWebsiteImgDl/${process.env.npm_package_version || '1.0.0'}`,
Connection: 'keep-alive',
},
signal: controller.signal,
});
Expand Down

0 comments on commit 3abf44b

Please sign in to comment.