Skip to content

Fix PDS Moover backups (Authorization header + CORS)#197

Open
jphastings wants to merge 2 commits into
ascorbic:mainfrom
jphastings:fix/cors-authorization-header
Open

Fix PDS Moover backups (Authorization header + CORS)#197
jphastings wants to merge 2 commits into
ascorbic:mainfrom
jphastings:fix/cors-authorization-header

Conversation

@jphastings
Copy link
Copy Markdown

@jphastings jphastings commented Jun 1, 2026

Hey Matt; the CORS middleware currently advertises Access-Control-Allow-Headers: *; as setting * wildcard does not cover the Authorization header it breaks some tools (like PDS Moover's backup), which need it.

I checked out the Bluesky PDS, and they just reflect all headers back by not specifying any allowed headers, so I swapped to that here.

This still doesn't fix PDS Moover, as it looks like there are other issues, but this fix removes the issue I had with the Authorization header!

The CORS middleware advertised `Access-Control-Allow-Headers: *`, but `*` wildcard does not cover the `Authorization` header. Authenticated cross-origin XRPC calls from web clients (e.g. PDS Moover's getRepoStatus) were being blocked at preflight. Lists the allowed headers explicitly instead.
@jphastings jphastings force-pushed the fix/cors-authorization-header branch 3 times, most recently from 9d3332f to ad262ec Compare June 2, 2026 07:17
My previous commit hand-listed allowed headers (to get Authorization working), but that quietly dropped others browsers need (accept-language, x-bsky-topics, etc). Omitting allowHeaders lets Hono echo the requested headers back, matching the [reference atproto PDS](https://github.com/bluesky-social/atproto/blob/7f5c4ceb0b6872cb921ba9c2fab8c38614414f6c/packages/pds/src/index.ts#L171) and covering anything future clients send.
@jphastings jphastings force-pushed the fix/cors-authorization-header branch from ad262ec to 4cd16af Compare June 2, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant