[whatwg/fetch] Allow accept-encoding header with value "identity" (#986)

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`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/986

Received on Saturday, 28 December 2019 20:48:56 UTC