Skip to content

Commit

Permalink
fix: handle feeds that block 'HEAD' check
Browse files Browse the repository at this point in the history
  • Loading branch information
lightpohl committed Apr 30, 2024
1 parent bd1a500 commit 23b6b5d
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions bin/async.js
Expand Up @@ -59,14 +59,19 @@ const download = async (options) => {
return;
}

const headResponse = await got(url, {
timeout: 30000,
method: "HEAD",
responseType: "json",
headers: {
accept: "*/*",
},
});
let headResponse = null;
try {
headResponse = await got(url, {
timeout: 30000,
method: "HEAD",
responseType: "json",
headers: {
accept: "*/*",
},
});
} catch (error) {
// unable to retrive head response
}

const tempOutputPath = getTempPath(outputPath);
const removeFile = () => {
Expand Down

0 comments on commit 23b6b5d

Please sign in to comment.