Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add expectRanges to XHRBlob to ensure Range requests give 206 status #1134

Merged
merged 2 commits into from Jul 23, 2018

Conversation

Projects
None yet
2 participants
@cmdcolin
Copy link
Contributor

cmdcolin commented Jul 23, 2018

This PR adds a concept called expectRanges to XHRBlob

It could be argued that this is more severe than a "loud warning" but if a server is doing HTTP 200 for a byte-range request it is very non-compliant

Ref #1132

@wafflebot wafflebot bot added the in progress label Jul 23, 2018

@rbuels rbuels added this to the 1.15.1 milestone Jul 23, 2018

if (req.readyState == 4) {
if (req.readyState == 2) {
if(!Util.isElectron() && req.status == 200 && request.expectRanges == true) {
req.abort();

This comment has been minimized.

@rbuels

rbuels Jul 23, 2018

Collaborator

Have you checked browser support for req.abort?

This comment has been minimized.

@cmdcolin

cmdcolin Jul 23, 2018

Author Contributor

It looks like it is pretty widely supported, goes back to ie7 even https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/abort (it appears different from cancellable promise which is a more weird thing it seems)

This comment has been minimized.

@rbuels

rbuels Jul 23, 2018

Collaborator

👍

@rbuels rbuels merged commit 9feec34 into dev Jul 23, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@wafflebot wafflebot bot removed the in progress label Jul 23, 2018

@cmdcolin cmdcolin deleted the add_expect_ranges branch Aug 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.