github / github/pages-gem

Serving SQLite database files with sql.js-httpvfs broken due to gzip encoding on HEAD requests

Offen
#952 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Ruby
Sterne
1.9k
Forks
360
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I have been using GitHub Pages to serve SQLite database files for a client-side app with sql.js-httpvfs, which requires HTTP Range requests to read parts of the database file.

Until recently, this setup worked correctly. However, now the sql.js-httpvfs worker throws an error:
Length of the file not known. It must either be supplied in the config or given by the HTTP server.

Upon inspecting the HTTP response headers, I see that HEAD requests respond with content-encoding: gzip. According to sql.js-httpvfs, this breaks range requests because the server returns compressed data on HEAD but serves uncompressed data on range requests, making the byte length calculation incorrect.

Example response headers from a HEAD request:
``
content-encoding: gzip
accept-ranges: bytes
content-length: 1288
``
This behavior causes sql.js-httpvfs to fail when trying to read the file size and ranges properly.

Could you please confirm if there has been a recent change in how GitHub Pages serves static files or handles gzip encoding on HEAD and Range requests? Is there a recommended workaround to properly serve files that need range requests without gzip interfering?

Thank you very much for your help!

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Keine Repository-Datei oder kein Test ist angegeben. Beginne damit, die HEAD- und Range-Anfragen gegen GitHub Pages für eine SQLite-Datei zu reproduzieren, und vergleiche anschließend die Header content-encoding und content-length; die Untersuchung ist abgeschlossen, wenn das Auslieferungsverhalten bestätigt und eine unterstützte Workaround-Lösung dokumentiert ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
sqlite
Bereich
databases, infrastructure
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.