Skip to content

Bug: Byte ranges generated by XhrFileReader.js are invalid #177

@robinfriedli

Description

@robinfriedli

The XhrFileReader defines the end of the byte range as such:

range[1] = Math.min(self._size, range[1]);

This is incorrect, because byte ranges are inclusive and should therefor always be lower than the size. It should:

range[1] = Math.min(self._size - 1, range[1]);

From mdn:

<range-end>
An integer in the given unit indicating the end position (zero-indexed & inclusive) of the requested range.

This may cause servers to reject the request with a 416

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions