diff --git a/src/utils/http.ts b/src/utils/http.ts index e57667f..8d0fd76 100644 --- a/src/utils/http.ts +++ b/src/utils/http.ts @@ -3,9 +3,10 @@ export type onProgress = (percent: number, total: number) => void; export const fetchWithProgress = async (url: string, onProgress?: onProgress, signal?: AbortSignal): Promise => { const response = await fetch(url, { signal }); const contentLength = response.headers.get('Content-Length'); + const isContentEncoded = !!response.headers.get('Content-Encoding'); - if (!contentLength) { - // fallback + if (!contentLength || isContentEncoded) { + // fallback to full buffer return response.arrayBuffer(); }