From 3c9022d8c7c0b49894f92b11cbed31db92742fc2 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 13 Feb 2024 00:25:47 -0500 Subject: [PATCH] fix: dont pass responseType, as we want a blob --- src/methods/download.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/methods/download.ts b/src/methods/download.ts index 9840d12..c5755c5 100644 --- a/src/methods/download.ts +++ b/src/methods/download.ts @@ -4,8 +4,13 @@ import { S5Client } from "../client.js"; import { CustomClientOptions, optionsToConfig } from "../utils/options.js"; import path from "path"; import { DEFAULT_UPLOAD_OPTIONS } from "#methods/upload.js"; -import { getS5DownloadCid, getS5MetadataCid } from "#generated/index.js"; +import { + getS5BlobCid, + getS5DownloadCid, + getS5MetadataCid, +} from "#generated/index.js"; import { addUrlQuery } from "#utils/url.js"; +import { customInstance } from "#axios.js"; /** * Custom download options. @@ -135,12 +140,7 @@ export async function downloadData( const config = optionsToConfig(this, DEFAULT_DOWNLOAD_OPTIONS, customOptions); - return await ( - await getS5DownloadCid(cid, { - ...config, - responseType: "arraybuffer", - }) - ).arrayBuffer(); + return await (await getS5DownloadCid(cid, config)).arrayBuffer(); } /**