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

WIP: Serve partial files #159

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

myers
Copy link

@myers myers commented Dec 28, 2023

  • needs to add header to advertise support for partial files
  • return correct response if the range requested isn't supported
  • return the whole file if the range requested is invalid
  • example should serve whole directory and check symlinks to only serve files in that directory
  • document why this is better than just read/seeking in python code
  • update RSGI spec with start, end parameters

@gi0baro
Copy link
Member

gi0baro commented Dec 29, 2023

@myers thank you for the PR, FYI I'm AFK during these days, I'll look at this after Jan 3rd

@gi0baro
Copy link
Member

gi0baro commented Jan 25, 2024

@myers I'm sorry for the late reply, but I finally managed to take a look at this.
I also wanted to release 1.0 before this, as the Hyper API changed and I didn't want to add protocol changes before porting the code to Hyper 1.0, thus this will need changes to adapt the code to 1.0.

That said, I'm not super intrigued by altering response_file method with all that logic; also considering the default response code for partial content should be 206, maybe the best option here is to add an additional method to RSGI spec like response_file_partial or response_file_range, WDYT?
Also, I would leave the headers management to the application, not the server itself.

@gi0baro gi0baro force-pushed the master branch 2 times, most recently from ff9588a to 1814868 Compare May 1, 2024 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants