diff --git a/src/loaders/FileLoader.js b/src/loaders/FileLoader.js index bfcb6e1a63cf9b..1e528eb11fb19b 100644 --- a/src/loaders/FileLoader.js +++ b/src/loaders/FileLoader.js @@ -109,7 +109,10 @@ class FileLoader extends Loader { const callbacks = loading[ url ]; const reader = response.body.getReader(); - const contentLength = response.headers.get( 'Content-Length' ); + + // Nginx needs X-File-Size check + // https://serverfault.com/questions/482875/why-does-nginx-remove-content-length-header-for-chunked-content + const contentLength = response.headers.get( 'Content-Length' ) || response.headers.get( 'X-File-Size' ); const total = contentLength ? parseInt( contentLength ) : 0; const lengthComputable = total !== 0; let loaded = 0;