support range requests

Aperta
#745 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
api

Direzione di ricerca

Inizia tracciando il modo in cui i client generati costruiscono le richieste e gestiscono le risposte binarie, quindi individua dove vengono esposti gli header HTTP e i codici di stato. Definisci il completamento in base all’invio di Range, all’accettazione di 200 o 206, alla segnalazione significativa di 416 e all’esposizione di Content-Range e Accept-Ranges per le risposte GET o HEAD.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Rust
Stelle
1k
Fork
142
Merge medio
19h 13m
PR unite (30g)
16

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di oxidecomputer/progenitor

Tutte le issue di oxidecomputer/progenitor

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.