[whatwg/xhr] `ProgressEvent.loaded` references decompressed length, but `total` references the Content-Length header (Issue #403)

cutiful created an issue (whatwg/xhr#403)

### What is the issue with the XMLHttpRequest Standard?

(Continuing from #388.) When processing a response body, `loaded` on `ProgressEvent` is calculated after codings are handled in the Fetch specification, i. e. decompressed data size. However, `total` is unconditionally the result of _extracting a length_ from the Content-Length header, which references compressed length when Content-Encoding is set to a known encoding. In those cases, the XHR specification should initialize _length_ to zero. That would make `lengthComputable` false, which is the expected behavior for compressed responses.

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

Message ID: <whatwg/xhr/issues/403@github.com>

Received on Thursday, 16 October 2025 15:57:59 UTC