fix: error on fetch for no headers on request (#4624)
* fix: error on fetch for no headers on request
This commit is contained in:
parent
5df085410b
commit
596c27b23e
1 changed files with 5 additions and 1 deletions
|
|
@ -20,7 +20,11 @@ export const useGetDownloadFileMutation: useMutationFunctionType<
|
||||||
const getDownloadImagesFn = async () => {
|
const getDownloadImagesFn = async () => {
|
||||||
if (!params) return;
|
if (!params) return;
|
||||||
// need to use fetch because axios convert blob data to string, and this convertion can corrupt the file
|
// 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 blob = await response.blob();
|
||||||
const url = URL.createObjectURL(blob);
|
const url = URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue