From 596c27b23e6f1cb382d06661718fb8a836471aaf Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 18 Nov 2024 13:45:05 -0300 Subject: [PATCH] fix: error on fetch for no headers on request (#4624) * fix: error on fetch for no headers on request --- .../src/controllers/API/queries/files/use-download-files.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/controllers/API/queries/files/use-download-files.ts b/src/frontend/src/controllers/API/queries/files/use-download-files.ts index 051f76532..4b4b753db 100644 --- a/src/frontend/src/controllers/API/queries/files/use-download-files.ts +++ b/src/frontend/src/controllers/API/queries/files/use-download-files.ts @@ -20,7 +20,11 @@ export const useGetDownloadFileMutation: useMutationFunctionType< const getDownloadImagesFn = async () => { if (!params) return; // need to use fetch because axios convert blob data to string, and this convertion can corrupt the file - const response = await fetch(`${getURL("FILES")}/download/${params.path}`); + const response = await fetch(`${getURL("FILES")}/download/${params.path}`, { + headers: { + Accept: "*/*", + }, + }); const blob = await response.blob(); const url = URL.createObjectURL(blob);