adding headers param in case it is needed for auth or similar

This commit is contained in:
NEOLPAR 2022-09-06 15:46:11 +01:00
parent f769e10f0c
commit 32863caf05
1 changed files with 6 additions and 2 deletions

View File

@ -307,9 +307,13 @@ export const uploadDirectory = async (
return files
}
exports.downloadTarballDirect = async (url: string, path: string) => {
exports.downloadTarballDirect = async (
url: string,
path: string,
headers = {}
) => {
path = sanitizeKey(path)
const response = await fetch(url)
const response = await fetch(url, { headers })
if (!response.ok) {
throw new Error(`unexpected response ${response.statusText}`)
}