mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
fix(core): Restore body parsing for all content-types for non webhook routes (no-changelog)(#6911)
Changes in https://github.com/n8n-io/n8n/pull/6394 removed xml body parsing for all non-webhook routes. This broken SAML endpoints as they need the XML body parser to function correctly.
This commit is contained in:
committed by
GitHub
parent
78c83168ac
commit
10c15874b2
@@ -11,7 +11,7 @@ import { N8nInstanceType } from '@/Interfaces';
|
||||
import type { IExternalHooksClass } from '@/Interfaces';
|
||||
import { ExternalHooks } from '@/ExternalHooks';
|
||||
import { send, sendErrorResponse, ServiceUnavailableError } from '@/ResponseHelper';
|
||||
import { rawBody, jsonParser, corsMiddleware } from '@/middlewares';
|
||||
import { rawBodyReader, bodyParser, corsMiddleware } from '@/middlewares';
|
||||
import { TestWebhooks } from '@/TestWebhooks';
|
||||
import { WaitingWebhooks } from '@/WaitingWebhooks';
|
||||
import { webhookRequestHandler } from '@/WebhookHelpers';
|
||||
@@ -98,7 +98,7 @@ export abstract class AbstractServer {
|
||||
this.app.use(compression());
|
||||
|
||||
// Read incoming data into `rawBody`
|
||||
this.app.use(rawBody);
|
||||
this.app.use(rawBodyReader);
|
||||
}
|
||||
|
||||
private setupDevMiddlewares() {
|
||||
@@ -274,8 +274,8 @@ export abstract class AbstractServer {
|
||||
this.setupDevMiddlewares();
|
||||
}
|
||||
|
||||
// Setup JSON parsing middleware after the webhook handlers are setup
|
||||
this.app.use(jsonParser);
|
||||
// Setup body parsing middleware after the webhook handlers are setup
|
||||
this.app.use(bodyParser);
|
||||
|
||||
await this.configure();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user