Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Express returns a non-compliant HTTP/206 response when gzip is enabled

Aperta
#185 9 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript, node.js
Ambito
backend

Direzione di ricerca

Inizia con la riproduzione collegata di nodejs-express-range-headers e RFC7233, quindi traccia il modo in cui il middleware di compressione gestisce le richieste Range e produce lo stato e gli header della risposta. Il lavoro è completato quando le risposte compresse non restituiscono più valori HTTP/206 Content-Range errati; verifica il comportamento con un test di regressione mirato, se il progetto ne fornisce uno.

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

Descrizione

CDNs (mostly Azure Front Door) is using HTTP Range Requests to retrieve data from Origin when caching enabled.

Express should ignore Range: requests header when gzip compression is in place since Express is unable to respond a HTTP/206 compliant answer with the right computed Content-Range header in the response that is taking the compressed data length into account.

A fair compliant workaround is to, in that very case of compression where computing Content-Range values would be too complex, ignore client's Range: header in the request, and answer the whole compressed content in a HTTP/200 response.

Handling Range: headers is optional so answering a HTTP/200 is OK.

Answering a HTTP/206 with wrong Content-Range values is notOK.

Meanwhile another workaround is to disable compression and make CDN handle it, or disable CDN caching, however it would be fair to expect Express to return a compliant HTTP response in any case.

References:

RFC7233

Details and highlighting Express behavior:

https://github.com/DanielLarsenNZ/nodejs-express-range-headers

Lingua principale
JavaScript
Stelle
2.8k
Fork
257
Merge medio
3g 15h
PR unite (30g)
3

Preparare l'ambiente

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 expressjs/compression

Tutte le issue di expressjs/compression

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.