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

Content-Length header missing on GET but present on HEAD request

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

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Reproduce the GET and HEAD requests against a large static file such as sizes.csv and compare the response headers, especially Content-Length, Content-Encoding, and Transfer-Encoding. Trace the request handling for these two methods and verify that a completed GET response exposes the expected length without breaking compressed responses.

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

Descrizione

When trying to request a file (both when using fetch from the browser or via httpie), the Content-Length header is present when performing a HEAD request, but absent when performing a GET request for the same file.

$ npx serve . & # running serve in the folder that contains a file named sizes.csv
$ http get http://localhost:3000/sizes.csv
HTTP/1.1 200 OK
Accept-Ranges: bytes
Connection: keep-alive
Content-Disposition: inline; filename="sizes.csv"
Content-Encoding: gzip
Content-Type: text/csv; charset=utf-8
Date: Tue, 01 Feb 2022 16:41:31 GMT
ETag: "fe6386cd1487ccd8226d4750f395b4bac29a9465"
Keep-Alive: timeout=5
Transfer-Encoding: chunked
Vary: Accept-Encoding

^C # aborted because I didn't want to download the actual file in this test
$ http head http://localhost:3000/sizes.csv
HTTP/1.1 200 OK
Accept-Ranges: bytes
Connection: keep-alive
Content-Disposition: inline; filename="sizes.csv"
Content-Length: 920509727
Content-Type: text/csv; charset=utf-8
Date: Tue, 01 Feb 2022 16:41:38 GMT
ETag: "fe6386cd1487ccd8226d4750f395b4bac29a9465"
Keep-Alive: timeout=5
Vary: Accept-Encoding


Lingua principale
JavaScript
Stelle
618
Fork
117
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 vercel/serve-handler

Tutte le issue di vercel/serve-handler

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.