SPB Git

spb/market-atlas

Public

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 (Sep 12, 2026) parent 51f65b7 Browse files

1 changed file +2 −0

Unified Split
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
Menu

Theme