Skip to content

Commit

Permalink
FileLoader: Evaluate X-File-Size header before Content-Length. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 committed Apr 22, 2024
1 parent 084aa1f commit c817054
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/loaders/FileLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c817054

Please sign in to comment.