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
Fixing a couple of issues with HTTP-Range for static files #414
Conversation
- fixed bug where a wrong Content-Length was calculated for Range requests on empty files - fixed bug where a wrong Content-Length was calculated for swapped Range values - do not silently ignore non-numeric value in Range - support HTTP-Range for final bytes (Range: bytes -42)
And why is range support for empty files useful? |
Also, which user agents actually use |
In the future, please do not bundle multiple changes into a single pull request, unless they all have been discussed and accepted already, odds are the whole patch gets rejected because of a small subset. |
Since handling range requests for empty files does not actually require additional code, i've just added it anyway. 6804499 |
Turns out a clean implementation is actually less code, that made the decision very simple. :) |
Wrong question. M was pretending "Content-Length: 1" and returned 0 |
It's defined in RFC 2616 §14.35.1, therefore a server should handle it, |
OK. Thank you. |
from RFC 2616 §14.35.1 If the last-byte-pos value is absent, or if the value is greater than or Your way doesn't handle that correctly atm. |
That's not a good reason, there are many things in the RFCs around HTTP that don't really belong in the real world. For example we will never support |
Moin sri,
Mojolicious had some problems with certain HTTP-Range requests.
Here are my changes:
for Range requests on empty files
for swapped Range values