You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
git handler: allow git-protocol header in CORS preflight responses #371
The git handler in src/handlers/git.js doesn't whitelist the git-protocol header in CORS preflight (OPTIONS) responses. This blocks browser-side git clients (e.g., isomorphic-git) from making cross-origin requests when using protocol v2, which sends git-protocol: version=2.
Symptom
Access to fetch at 'https://pod.example/path/repo/info/refs?service=git-upload-pack'
from origin 'https://jss.live' has been blocked by CORS policy:
Request header field git-protocol is not allowed by Access-Control-Allow-Headers
in preflight response.
Fix
In the OPTIONS preflight response for git-protocol routes, add git-protocol to Access-Control-Allow-Headers. Suggested allowed-headers list:
The browser-side git frontend at jss.live/git/ (repo: JavaScriptSolidServer/git) currently works around this by setting protocolVersion: 1 in git.listServerRefs. That's a client workaround; the proper fix is server-side so smart-HTTP v2 works for all clients.
Activity
git handler: allow Git-Protocol in CORS preflight (#371) (#372)
git handler: drop dead URIError catch, add CORS to remaining 4xx paths
git handler: collapse multi-slash in URL before forwarding to http-ba…
server: inject CORS headers on Fastify-internal errors (#376) (#421)
test: git handler HTTP contract coverage + fix DATA_ROOT pollution in…
test: git handler HTTP contract coverage + fix DATA_ROOT pollution in…
fix(git): WAC preHandler 401/402/403 responses carry the git CORS hea…