Observed on June 7, 2026:
raw.githubusercontent.com/...returns normal Git objects directly.- For Git LFS files,
raw.githubusercontent.com/...returns the small text pointer rather than the stored object. github.com/{owner}/{repo}/raw/{ref}/{path}returns302:- Normal Git objects redirect to
raw.githubusercontent.com. - Git LFS objects redirect to
media.githubusercontent.com.
- Normal Git objects redirect to
- Ranged requests survive both redirect chains. A request for
Range: bytes=0-15produced a final206 Partial Contentresponse with the expectedContent-Rangeand 16-byte body. - Both final content hosts advertise
Access-Control-Allow-Origin: *andAccept-Ranges: bytes. - The initial
github.com/.../raw/...redirect does not provide usable CORS headers. Browserfetch(..., { mode: "cors" })fails before following the redirect for both normal and LFS files.
The service worker must fetch and rewrap content to preserve the preview
origin, relative paths, MIME correction, and runtime requests. It therefore
cannot replace its raw.githubusercontent.com fetch with the GitHub /raw
resolver. Git LFS support is intentionally deferred.
Observed on July 4, 2026:
- Raw Gist URLs use
https://gist.githubusercontent.com/{user}/{gistId}/raw/{revision?}/{file}. gist.github.com/{user}/{gistId}/raw/...redirects to the matchinggist.githubusercontent.com/...URL.gist.githubusercontent.comcan be fetched directly from GitHub Pages. It returns CORS-compatible raw responses withAccess-Control-Allow-Origin: *,Accept-Ranges: bytes, andContent-Type: text/plain.- Multi-file gists can use sibling relative paths such as
./style.cssand./index.jsif the preview route preserves the shared raw prefix.
Final decision: do not support Gist for now.
Gist support is technically feasible for raw Gist URLs, but it is a marginal
use case for this project. The current app is centered on GitHub repository
files with an owner/repo/ref/path model. Gists use a separate
owner/gistId/revision?/file model, have no normal directory tree, and bare
Gist page URLs identify a file collection rather than a single preview target.
Adding Gist cleanly would require a parallel link parser and service-worker route namespace rather than extending the existing repository model. That complexity is not justified by the expected value.