Skip to content

Commit 8d54382

Browse files
fix(api): specify allowed HTTP methods for legacy proxy
The proxy configuration was missing explicit HTTP methods, which could cause unexpected behavior for non-GET requests. Adding the full set of standard methods ensures all request types are properly forwarded to the legacy backend.
1 parent 2bc7799 commit 8d54382

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

apps/api/src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ async function bootstrap() {
2424
// Redireciona tudo o que o NestJS NÃO conhece para o backend legado (Strangler Fig)
2525
await app.register(fastifyHttpProxy as any, {
2626
upstream: `http://localhost:${legacyPort}`,
27+
httpMethods: ['DELETE', 'GET', 'HEAD', 'PATCH', 'POST', 'PUT'],
2728
replyOptions: {
2829
rewriteRequestHeaders: (_request: any, headers: any) => headers,
2930
}

0 commit comments

Comments
 (0)