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 support for range requests #124

Closed
Kaliumhexacyanoferrat opened this issue Nov 2, 2020 · 0 comments · Fixed by #207
Closed

Add support for range requests #124

Kaliumhexacyanoferrat opened this issue Nov 2, 2020 · 0 comments · Fixed by #207
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@Kaliumhexacyanoferrat
Copy link
Owner

Kaliumhexacyanoferrat commented Nov 2, 2020

As the developer of a web application, I would like my clients to be able to request ranges, so that range-dependent functionality (e.g. resumption of downloads) can be provided.

Example

var download = Download.FromFile("./large.dat")
                       .Add(RangeSupport.Create()); // or convenience: .AddRangeSupport()

Host.Create()
    .Handler(download)
    .Run();

Acceptance criteria

  • The requested range can be fetched as a typed and parsed instance from the IRequest
  • The range support is implemented in a new concern placed in the IO module
  • The implementation sends a Accept-Ranges: bytes header to indicate support on GET and HEAD requests (e.g. for download managers)
  • The implementation returns a 200 and the original response if the content returned by the handler cannot be ranged/seeked
  • The implementation returns a 416 if the range cannot be satisfied
  • The implementation returns a 206 if the range can be satisfied
  • The implementation does not support multiple ranges
  • Range support is enabled for GET requests only
  • The concern analyzes the request whether a range is requested and replaced the content returned by the server with a ranged content if so
  • There are at least acceptance tests for all of the scenarios described above
@Kaliumhexacyanoferrat Kaliumhexacyanoferrat added enhancement New feature or request good first issue Good for newcomers labels Nov 2, 2020
@Kaliumhexacyanoferrat Kaliumhexacyanoferrat linked a pull request Jun 14, 2021 that will close this issue
@Kaliumhexacyanoferrat Kaliumhexacyanoferrat added this to the Version 6.0 milestone Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant