fix: error on fetch for no headers on request (#4624)

* fix: error on fetch for no headers on request
This commit is contained in:
anovazzi1 2024-11-18 13:45:05 -03:00 committed by GitHub
commit 596c27b23e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);