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 range requests #745

Open
jclulow opened this issue Mar 24, 2024 · 1 comment
Open

support range requests #745

jclulow opened this issue Mar 24, 2024 · 1 comment

Comments

@jclulow
Copy link
Collaborator

jclulow commented Mar 24, 2024

It does not currently seem possible to be able to make a HTTP range request for an endpoint that returns a binary asset (i.e., not a JSON-formatted response). I believe we would need the following things:

  • some way to add a Range header with a value like bytes=1000-4999 (representing a request for 4000 bytes starting at offset 1000) on a request as part of building it
  • to accept either a HTTP 200 OK or a HTTP 206 Partial Content response in the case of a range request
  • to provide a useful error in the case that we get a HTTP 416 Range Not Satisfiable response
  • to expose the value of the Content-Range header in the response to the consumer so that we can confirm that the server understood our range request
  • to expose the value of the Aceept-Ranges header from the response to a GET or (especially) HEAD request, so that a client can determine if the server is reporting range request support

I couldn't immediately find a way for an OpenAPI definition document to report support for range requests, so it would be up to the consumer and the server to correctly negotiate them using the regular pattern of headers and HEAD requests.

@ahl
Copy link
Collaborator

ahl commented Mar 29, 2024

I think I'd expect range headers to appear in the OpenAPI description of the operation. If they existed, I'd expect progenitor to emit code to let you specify them. I know we may resolve your proximate need with #750, but there may be dropshot facilities we could build for a more robust binary asset response.

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

No branches or pull requests

2 participants