From 23b6b5d65b2b9cbad7e35808739cec4364b7318c Mon Sep 17 00:00:00 2001 From: Joshua Pohl Date: Tue, 30 Apr 2024 15:43:37 -0600 Subject: [PATCH] fix: handle feeds that block 'HEAD' check --- bin/async.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/bin/async.js b/bin/async.js index 5253e09..836528f 100644 --- a/bin/async.js +++ b/bin/async.js @@ -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 = () => {