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

support for range requests #259

Open
raymondben opened this issue Feb 19, 2020 · 0 comments · May be fixed by #290
Open

support for range requests #259

raymondben opened this issue Feb 19, 2020 · 0 comments · May be fixed by #290

Comments

@raymondben
Copy link

httpuv's static file serving doesn't currently support range requests (i.e. requests for only part of a file). This would be very useful! servr supports this, but by reading the static content into memory first rather than reading from disk (see yihui/servr#35 and yihui/servr#41).
The need for range request support in httpuv/shiny has been mentioned in various places, see e.g.:

Range request support in shiny should (?) be relatively straightforward once httpuv supports it, just requiring a couple of extra headers to be passed to the shiny app.

atheriel added a commit to atheriel/httpuv that referenced this issue Nov 27, 2020
This includes

* Parsing and validation of the most common forms[0] of the `Range`
  header, namely `bytes=0-1000` and `bytes=1001-`, for serving slices of
  files and enabling resumable downloads, etc.

* Support for returning partial files matching these slices on Unix
  platforms.

* Support for returning the appropriate `Content-Range` header and HTTP
  206 responses for these requests.

* Tests for these features (some of which are skipped on Windows).

It does not support Windows as of yet, and there is no support for
multipart ranges[2] or the `If-Range` header[3].

Since `Range` header support is always optional (a server can just
respond with the whole file and a HTTP 200 instead), we just fall back
on existing behaviour in these cases instead of issuing some kind of
error.

Along these same lines, we don't yet advertise that we support the
`Range` header by sending an `Accept-Ranges: bytes` header[4] on other
GET/HEAD requests.

Closes rstudio#259.

[0]: https://tools.ietf.org/html/rfc7233#section-3.1
[2]: https://tools.ietf.org/html/rfc7233#appendix-A
[3]: https://tools.ietf.org/html/rfc7233#section-3.2
[4]: https://tools.ietf.org/html/rfc7233#section-2.3
atheriel added a commit to atheriel/httpuv that referenced this issue Dec 1, 2020
This includes

* Parsing and validation of the most common forms[0] of the `Range`
  header, namely `bytes=0-1000` and `bytes=1001-`, for serving slices of
  files and enabling resumable downloads, etc.

* Support for returning partial files matching these slices on Unix
  platforms.

* Support for returning the appropriate `Content-Range` header and HTTP
  206 responses for these requests.

* Tests for these features (some of which are skipped on Windows).

It does not support Windows as of yet, and there is no support for
multipart ranges[2] or the `If-Range` header[3].

Since `Range` header support is always optional (a server can just
respond with the whole file and a HTTP 200 instead), we just fall back
on existing behaviour in these cases instead of issuing some kind of
error.

Along these same lines, we don't yet advertise that we support the
`Range` header by sending an `Accept-Ranges: bytes` header[4] on other
GET/HEAD requests.

Closes rstudio#259.

[0]: https://tools.ietf.org/html/rfc7233#section-3.1
[2]: https://tools.ietf.org/html/rfc7233#appendix-A
[3]: https://tools.ietf.org/html/rfc7233#section-3.2
[4]: https://tools.ietf.org/html/rfc7233#section-2.3
atheriel added a commit to atheriel/httpuv that referenced this issue Dec 2, 2020
This includes

* Parsing and validation of the most common forms[0] of the `Range`
  header, namely `bytes=0-1000` and `bytes=1001-`, for serving slices of
  files and enabling resumable downloads, etc.

* Support for returning partial files matching these slices on Unix
  platforms.

* Support for returning the appropriate `Content-Range` header and HTTP
  206 responses for these requests.

* Tests for these features (some of which are skipped on Windows).

It does not support Windows as of yet, and there is no support for
multipart ranges[2] or the `If-Range` header[3].

Since `Range` header support is always optional (a server can just
respond with the whole file and a HTTP 200 instead), we just fall back
on existing behaviour in these cases instead of issuing some kind of
error.

Along these same lines, we don't yet advertise that we support the
`Range` header by sending an `Accept-Ranges: bytes` header[4] on other
GET/HEAD requests.

Closes rstudio#259.

[0]: https://tools.ietf.org/html/rfc7233#section-3.1
[2]: https://tools.ietf.org/html/rfc7233#appendix-A
[3]: https://tools.ietf.org/html/rfc7233#section-3.2
[4]: https://tools.ietf.org/html/rfc7233#section-2.3
atheriel added a commit to atheriel/httpuv that referenced this issue Dec 3, 2020
This includes

* Parsing and validation of the most common forms[0] of the `Range`
  header, namely `bytes=0-1000` and `bytes=1001-`, for serving slices of
  files and enabling resumable downloads, etc.

* Support for returning partial files matching these slices on Unix
  platforms.

* Support for returning the appropriate `Content-Range` header and HTTP
  206 responses for these requests.

* Tests for these features (some of which are skipped on Windows).

It does not support Windows as of yet, and there is no support for
multipart ranges[2] or the `If-Range` header[3].

Since `Range` header support is always optional (a server can just
respond with the whole file and a HTTP 200 instead), we just fall back
on existing behaviour in these cases instead of issuing some kind of
error.

Along these same lines, we don't yet advertise that we support the
`Range` header by sending an `Accept-Ranges: bytes` header[4] on other
GET/HEAD requests.

Closes rstudio#259.

[0]: https://tools.ietf.org/html/rfc7233#section-3.1
[2]: https://tools.ietf.org/html/rfc7233#appendix-A
[3]: https://tools.ietf.org/html/rfc7233#section-3.2
[4]: https://tools.ietf.org/html/rfc7233#section-2.3
atheriel added a commit to atheriel/httpuv that referenced this issue Dec 3, 2020
This includes

* Parsing and validation of the most common forms[0] of the `Range`
  header, namely `bytes=0-1000` and `bytes=1001-`, for serving slices of
  files and enabling resumable downloads, etc.

* Support for returning partial files matching these slices on Unix
  platforms.

* Support for returning the appropriate `Content-Range` header and HTTP
  206 responses for these requests.

* Tests for these features (some of which are skipped on Windows).

It does not support Windows as of yet, and there is no support for
multipart ranges[2] or the `If-Range` header[3].

Since `Range` header support is always optional (a server can just
respond with the whole file and a HTTP 200 instead), we just fall back
on existing behaviour in these cases instead of issuing some kind of
error.

Along these same lines, we don't yet advertise that we support the
`Range` header by sending an `Accept-Ranges: bytes` header[4] on other
GET/HEAD requests.

Closes rstudio#259.

[0]: https://tools.ietf.org/html/rfc7233#section-3.1
[2]: https://tools.ietf.org/html/rfc7233#appendix-A
[3]: https://tools.ietf.org/html/rfc7233#section-3.2
[4]: https://tools.ietf.org/html/rfc7233#section-2.3
atheriel added a commit to atheriel/httpuv that referenced this issue Dec 4, 2020
This includes

* Parsing and validation of the most common forms[0] of the `Range`
  header, namely `bytes=0-1000` and `bytes=1001-`, for serving slices of
  files and enabling resumable downloads, etc.

* Support for returning partial files matching these slices on Unix
  platforms.

* Support for returning the appropriate `Content-Range` header and HTTP
  206 responses for these requests.

* Tests for these features (some of which are skipped on Windows).

It does not support Windows as of yet, and there is no support for
multipart ranges[2] or the `If-Range` header[3].

Since `Range` header support is always optional (a server can just
respond with the whole file and a HTTP 200 instead), we just fall back
on existing behaviour in these cases instead of issuing some kind of
error.

Along these same lines, we don't yet advertise that we support the
`Range` header by sending an `Accept-Ranges: bytes` header[4] on other
GET/HEAD requests.

Closes rstudio#259.

[0]: https://tools.ietf.org/html/rfc7233#section-3.1
[2]: https://tools.ietf.org/html/rfc7233#appendix-A
[3]: https://tools.ietf.org/html/rfc7233#section-3.2
[4]: https://tools.ietf.org/html/rfc7233#section-2.3
atheriel added a commit to atheriel/httpuv that referenced this issue Dec 4, 2020
This includes

* Parsing and validation of the most common forms[0] of the `Range`
  header, namely `bytes=0-1000` and `bytes=1001-`, for serving slices of
  files and enabling resumable downloads, etc.

* Support for returning partial files matching these slices on Unix
  and Windows platforms.

* Support for returning the appropriate `Content-Range` header and HTTP
  206 responses for these requests.

* Support for sending the `Accept-Ranges: bytes` header when appropriate.

* Tests for these features.

There is no support for suffix length ranges, multipart ranges[2] or the
`If-Range` header[3].

Since `Range` header support is always optional (a server can just
respond with the whole file and a HTTP 200 instead), we just fall back
on existing behaviour in these cases instead of issuing some kind of
error.

Closes rstudio#259.

[0]: https://tools.ietf.org/html/rfc7233#section-3.1
[2]: https://tools.ietf.org/html/rfc7233#appendix-A
[3]: https://tools.ietf.org/html/rfc7233#section-3.2
[4]: https://tools.ietf.org/html/rfc7233#section-2.3
atheriel added a commit to atheriel/httpuv that referenced this issue Dec 4, 2020
This includes

* Parsing and validation of the most common forms[0] of the `Range`
  header, namely `bytes=0-1000` and `bytes=1001-`, for serving slices of
  files and enabling resumable downloads, etc.

* Support for returning partial files matching these slices on Unix
  and Windows platforms.

* Support for returning the appropriate `Content-Range` header and HTTP
  206 responses for these requests.

* Support for sending the `Accept-Ranges: bytes` header when appropriate.

* Tests for these features.

There is no support for suffix length ranges, multipart ranges[2] or the
`If-Range` header[3].

Since `Range` header support is always optional (a server can just
respond with the whole file and a HTTP 200 instead), we just fall back
on existing behaviour in these cases instead of issuing some kind of
error.

Closes rstudio#259.

[0]: https://tools.ietf.org/html/rfc7233#section-3.1
[2]: https://tools.ietf.org/html/rfc7233#appendix-A
[3]: https://tools.ietf.org/html/rfc7233#section-3.2
[4]: https://tools.ietf.org/html/rfc7233#section-2.3
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 a pull request may close this issue.

1 participant