Skip to content

Range Header is not obeyed when downloading a file #1346

Closed

Description

@individual-it

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

Activity

  1. PVince81 commented on Apr 30, 2020

    @PVince81
    Contributor

    First naive attempt here: cs3org/reva#701

  2. PVince81 commented on May 5, 2020

    @PVince81
    Contributor

    @butonic FYI

  3. PVince81 commented on May 5, 2020

    @PVince81
    Contributor

    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

  4. transferred this issue fromowncloud/ocis-revaon Jan 18, 2021
  5. butonic commented on Feb 3, 2021

    @butonic
    Contributor

    tracked in reva as cs3org/reva#1395

  6. phil-davis commented on Feb 4, 2021

    @phil-davis
    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.

  7. stale commented on Apr 5, 2021

    @stale

    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.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions