1
0
Fork 0
mirror of synced 2024-06-26 10:00:41 +12:00

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

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}`)
}