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

Range Header is not obeyed when downloading a file #1346

Closed
individual-it opened this issue Jan 21, 2020 · 6 comments
Closed

Range Header is not obeyed when downloading a file #1346

individual-it opened this issue Jan 21, 2020 · 6 comments

Comments

@individual-it
Copy link
Member

found when starting to run API tests with OCIS

try to download only a range of a file, e.g.: curl http://localhost:9140/remote.php/webdav/home/welcome.txt -u einstein:relativity -H "Range: bytes=51-77"

Expected behaviour:

only a range of the file should be downloaded

Actual behaviour:

the complete file is downloaded

@PVince81
Copy link
Contributor

First naive attempt here: cs3org/reva#701

@PVince81
Copy link
Contributor

PVince81 commented May 5, 2020

  • add storage capability for range requests
  • expose "Accept-Range" header on Webdav HEAD call if the storage supports it
  • extend storage interface to have range requests as current Download method doesn't have a way https://github.com/cs3org/reva/blob/master/pkg/storage/storage.go#L41
  • extend dataprovider to pass in the range request to the storage
  • react on "Range" header in Webdav GET call
  • CS3 API extension for range requests ??

@butonic FYI

@PVince81
Copy link
Contributor

PVince81 commented May 5, 2020

another alternative approach would be calling Download and then seeking forward, but I'm not sure at which level this would still result in the whole stream being passed over the network between the storage and the seeker

@butonic butonic transferred this issue from owncloud/ocis-reva Jan 18, 2021
@butonic
Copy link
Member

butonic commented Feb 3, 2021

tracked in reva as cs3org/reva#1395

@phil-davis
Copy link
Contributor

Note: we added tests in owncloud/core#38247 to check various combinations of range request.
In the RFC it is acceptable for a server to reply to a range request with either status 206 and the range(s) requested (e.g. a multi-part range request) or to reply with status 200 and send the whole file. For example, if the server does not even support range requests it is free to "ignore" the requested ranges and just deliver the whole file. Also the server is free to decide its own "optimization" of the reply - for example, if the request is for a part of a small file then the server can choose to just send the whole file, rather than "bother" to send just the exact requested range.

We made the tests cope with that allowed variation.

@stale
Copy link

stale bot commented Apr 5, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status:Stale label Apr 5, 2021
@settings settings bot removed the p3-medium label Apr 7, 2021
@stale stale bot closed this as completed Apr 17, 2021
oCIS Tech Preview automation moved this from To do to Done Apr 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

5 participants