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:
कारतोफ्फेलस्क्रिप्ट™
2023-08-11 09:18:33 +02:00
committed by GitHub
parent 78c83168ac
commit 10c15874b2
4 changed files with 43 additions and 52 deletions

View File

@@ -30,7 +30,7 @@ import {
TagsController,
UsersController,
} from '@/controllers';
import { rawBody, jsonParser, setupAuthMiddlewares } from '@/middlewares';
import { rawBodyReader, bodyParser, setupAuthMiddlewares } from '@/middlewares';
import { InternalHooks } from '@/InternalHooks';
import { LoadNodesAndCredentials } from '@/LoadNodesAndCredentials';
@@ -118,7 +118,7 @@ export const setupTestServer = ({
enabledFeatures,
}: SetupProps): TestServer => {
const app = express();
app.use(rawBody);
app.use(rawBodyReader);
app.use(cookieParser());
const testServer: TestServer = {
@@ -153,7 +153,7 @@ export const setupTestServer = ({
if (!endpointGroups) return;
app.use(jsonParser);
app.use(bodyParser);
const [routerEndpoints, functionEndpoints] = classifyEndpointGroups(endpointGroups);