diff --git a/foundry/packages/backend/src/index.ts b/foundry/packages/backend/src/index.ts index b6fe3e2..17acb4a 100644 --- a/foundry/packages/backend/src/index.ts +++ b/foundry/packages/backend/src/index.ts @@ -282,6 +282,15 @@ export async function startBackend(options: BackendStartOptions = {}): Promise { + // TEMPORARY: dump all request headers to diagnose duplicate callback requests + // (Railway nginx proxy_next_upstream? Cloudflare retry? browser?) + // Remove once root cause is identified. + const allHeaders: Record = {}; + c.req.raw.headers.forEach((value: string, key: string) => { + allHeaders[key] = value; + }); + logger.info({ headers: allHeaders, url: c.req.url }, "github_callback_headers"); + const code = c.req.query("code"); const state = c.req.query("state"); if (!code || !state) {