You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just began to work on implementing RFC 7233 about Range Requests.
Here is the analysis of how I think it should be implemented, followed by open points for which I will need help:
With this implemented, the headers should all be OK, but now comes the question of the data itself.
If those headers are set (through make_conditional method), we must (?) ensure that the data sent by the server actually reflect those headers.
Is this the role of Werkzeug, or should this be left to Flask ?
If this should be implemented in Werkzeug, can we implement this in a generic way ?
If we implement this in a generic way, we will not be able to use things like seek() methods, and thus will make file (through wrap_file method) Range Requests pretty inneficient.
Edit: One answer can be to wrap responses, which are iterable, with a RangeWrapper. Its role would be to yield only the data contained within range. This RangeWrapper should also be able to support underlying streams that are seekable, that way we do not need to read and drop if not necessary.
The text was updated successfully, but these errors were encountered:
I just began to work on implementing RFC 7233 about Range Requests.
Here is the analysis of how I think it should be implemented, followed by open points for which I will need help:
wrappers.make_conditional
, new signatureAlso, make_conditional can now raise
RequestedRangeNotSatisfiable
exception.datastructures
: newRange.to_content_range_header(self, length)
method, to generateContent-Range
header value.exceptions.RequestedRangeNotSatisfiable
on order to addContent-Range
header supporthttp.is_resource_modified
new signatureIt should be able to take
If-Range
header into account, but in order to keep current behavior, disabled by default.With this implemented, the headers should all be OK, but now comes the question of the data itself.
If those headers are set (through
make_conditional
method), we must (?) ensure that the data sent by the server actually reflect those headers.seek()
methods, and thus will make file (throughwrap_file
method) Range Requests pretty inneficient.Edit: One answer can be to wrap responses, which are iterable, with a
RangeWrapper
. Its role would be to yield only the data contained within range. ThisRangeWrapper
should also be able to support underlying streams that are seekable, that way we do not need to read and drop if not necessary.The text was updated successfully, but these errors were encountered: