Skip to content

ProgressEvent.loaded references decompressed length, but total references the Content-Length header #403

@cutiful

Description

@cutiful

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions