SPB Git forge

spb/market-atlas

Public
12commits 1branches 0releases
1.1 MBsize
maindefault branch
10 days agolast push
TypeScript 96.7% SQL 1.6% CSS 0.8% JavaScript 0.5%

api: edge proxy must not claim OPTIONS /* (cors preflight owns it)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Simon-Pierre Boucher committed 12 days ago (Sep 12, 2026) parent 51f65b7

1 changed file +2 −0

modified apps/api/src/api/server.ts +2 −0
@@ -95,6 +95,8 @@ export async function buildServer(): Promise<FastifyInstance> {
95 95 rewritePrefix: "/",
96 96 websocket: false,
97 97 http2: false,
98 + // @fastify/cors already owns OPTIONS /* (preflight) — proxy every other method.
99 + httpMethods: ["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE"],
98 100 replyOptions: { rewriteRequestHeaders: (req, headers) => ({ ...headers, "x-forwarded-host": req.headers.host ?? "", "x-forwarded-proto": (req.headers["x-forwarded-proto"] as string) ?? "https" }) },
99 101 });
100 102 logger.info({ upstream: config.webUpstream }, "edge mode: proxying non-API paths to the web app");
101 103