Return `Last-Modified` header in response for compatibility with Live.js

Aperta
#7 2 commenti 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
clojure
Ambito
backend

Direzione di ricerca

Inizia individuando la gestione delle risposte per i file statici e il relativo percorso delle richieste HEAD in babashka.http-server. Confronta il comportamento necessario con ring.middleware.not-modified, quindi verifica che le risposte includano Last-Modified basato sul file servito, in modo che Live.js non dipenda da Content-Length.

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

Descrizione

I can contribute a PR here if desired. Just want to document the bug first.

Description:
babashka.http-server is used with Live.js to hot-reload changes to HTML, CSS, and JS. It uses HEAD requests to check the following headers: Etag, Last-Modified, Content-Length, and Content-Type.

Problem:
babashka.http-server doesn't return Last-Modified headers in the HTTP response. This means Live.js will fall back to using Content-Length to determine if there are new changes. It's possible for this to cause missed reloads since some changes (such as changing an integer in CSS) will result in the same Content-Length even though the content has changed.

When I use python3 -m http.server to serve the same files, I don't miss any changes even if the output file length is the same.

Solution:
Use ring.middleware.not-modified or something similar to add the Last-Modified to the HTTP responses.

Lingua principale
Clojure
Stelle
86
Fork
12
Merge medio
1m
PR unite (30g)
1

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.

Issue simili

Altre issue su Clojure

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.