From c817054a1c8d1f904d18baea1073b5868e30dca3 Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Mon, 22 Apr 2024 10:27:32 +0200 Subject: [PATCH] FileLoader: Evaluate `X-File-Size` header before `Content-Length`. (#28169) --- src/loaders/FileLoader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/loaders/FileLoader.js b/src/loaders/FileLoader.js index 1e528eb11fb19b..f89b3fd77a708d 100644 --- a/src/loaders/FileLoader.js +++ b/src/loaders/FileLoader.js @@ -112,7 +112,7 @@ class FileLoader extends Loader { // 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 contentLength = response.headers.get( 'X-File-Size' ) || response.headers.get( 'Content-Length' ); const total = contentLength ? parseInt( contentLength ) : 0; const lengthComputable = total !== 0; let loaded = 0;