Skip to content

Conversation

danielx
Copy link
Contributor

@danielx danielx commented Jun 14, 2017

Some media download APIs does not support partial downloads and do not return a 'Content-length' or 'Content-range' header and is therefore never considered done.

This change is to consider responses where the media length is unknown to be done.

This commit could potentially break media downloads where the API supports partial download and only returns a 'Content-length' header when the entire file has been served/read.

This commit fixes issue #15

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 14, 2017
@danielx danielx changed the title Handle unknown media length. MediaIoBaseDownload: Handle unknown media length Jun 14, 2017
Some media download APIs does not support partial downloads and do not return a 'Content-length' or 'Content-range' header and is therefore never considered done. This change is to consider responses where the media length is unknown to be done. This commit could potentially break media downloads where the API supports partial download and only returns a 'Content-length' header when the entire file has been served/read. This commit fixes issue #15
@YBadiss
Copy link

YBadiss commented Jul 17, 2017

How is this a fix? Doesn't it mean that if I rely on the done flag, I'll ever only get the first chunk of the file?

@danielx
Copy link
Contributor Author

danielx commented Jul 17, 2017

@YBadiss only if the server does not respond with a content-length or content-range header which AFAIK it does for all APIs supporting chunked downloads.

@bantini bantini requested a review from theacodes January 16, 2018 22:16
@theacodes theacodes merged commit 4406778 into googleapis:master Jan 16, 2018
@theacodes
Copy link
Contributor

Thanks, @danielx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

4 participants