-
-
Notifications
You must be signed in to change notification settings - Fork 170
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
Response: support range requests for files #5153
Conversation
6dbbaee
to
c1dff92
Compare
c1dff92
to
12f19bc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't yet tested it or checked for edge cases, but in general (code structure) it looks really good already.
$size = static::size($file); | ||
$end ??= $size; | ||
|
||
if ($end === $size) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this also check for start being 0? Otherwise the full file is returned even when the beginning wasn't requested.
): void { | ||
$size = static::size($file); | ||
$end ??= $size; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there should be checks for start < 0
, start >= end
and end > size
here as well, throwing an exception to provide extra safety and for those who use this method directly.
What's the state of this? Should we keep this in the lab and remove the PR? |
It's out here because I need help from the rest of the team. I won't get much further on my own. If this happens now or when, to be decided. |
Closing this for now. PR is referenced in corresponding issue and can be revisited when tackling this again. |
It's a start... but I think I am at the point where I need input from others