New issue
Advanced search Search tips

Issue 737617 link

Starred by 6 users

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Prevent resuming download if source has changed

Project Member Reported by jakearchibald@chromium.org, Jun 28 2017

Issue description

It seems like we depend on an Etag or Last-Modified to be present before we allow downloads to resume. However, downloads happily resume if the ETag/Last-Modified/Content-Length has changed between chunks, despite these being strong indications that the content has changed, and the previously fetched chunks may be invalid.

This could leave the user with a file that's corrupt, which could (if the user is unluck enough) do some damage.

Test: https://github.com/jakearchibald/range-request-test (sorry, I tried to externally host it, but fontend servers kept messing with the behaviour)

You'll need a recent version of node. I'm using 8.0.0. Once the project is checked out, run:

npm install 
npm run serve

Then visit http://localhost:3000.

In the Test Download section, select:

* 100 MB
* Accept range
* Include ETag (and/or Last-Modified)
* CHEESE

Click "Download".

After a few seconds, pause the download.

Press "Close last download connection" (since Chrome holds onto the connection by default).

Select "petril" - this changes the content downloaded, along with the ETag & Last-Modified headers.

Resume the download. Chrome will send a range request for the rest of the resource, and ignore the header changes.
 
https://www.youtube.com/watch?v=KHlsD1dubRc - video showing the steps above
I think Chrome download restart the whole file if strong validators don't match.
Thanks for providing the video, does the http connection get closed?

The pause/resume check strong validators only for resume in new http connection.

Comment 4 by qin...@chromium.org, Mar 29 2018

Owner: xingliu@chromium.org
Status: Assigned (was: Untriaged)
Chrome should restart from beginning if strong validators change. assigning to xingliu@ to investigate
I just reran this test and it's still a problem. Yeah, the connection is closed. The console window shows a new connection being made.

However, in HTTP/2, the existing connection may be reused for the range request. This should still check validators.
FWIW, Firefox (the only browser that does the right thing here) fails the download if validators change. However, restarting the download is also good.

Sign in to add a comment