-
Notifications
You must be signed in to change notification settings - Fork 359
Description
Currently, if I want to display a progress bar of how much data has been downloaded, I have to check content-length
header to get the amount of all data so that I can correctly display the progress bar as I stream chunks of data into a JavaScript array. But the issue is that if server is using content-encoding
set to gzip
, then content-length
tells how large is compressed data, not uncompressed. But what I am getting in chunks in uncompressed. So there should be a way for me to get how large is uncompressed data.
One way to achieve this is to do HEAD request with accept-encoding
header set to identity
. This would force the server to tell me the real size of the payload. But the issue is that currently accept-encoding
header is not allowed to be set for fetch
requests. I would ask that an exception is made for identity
.