mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
🔀 Merge branch 'xml-body-parser-webhooks' of https://github.com/quansenB/n8n into quansenB-xml-body-parser-webhooks
This commit is contained in:
commit
b6873e318d
|
@ -77,6 +77,7 @@
|
||||||
"@types/jsonwebtoken": "^8.3.4",
|
"@types/jsonwebtoken": "^8.3.4",
|
||||||
"basic-auth": "^2.0.1",
|
"basic-auth": "^2.0.1",
|
||||||
"body-parser": "^1.18.3",
|
"body-parser": "^1.18.3",
|
||||||
|
"body-parser-xml": "^1.1.0",
|
||||||
"compression": "^1.7.4",
|
"compression": "^1.7.4",
|
||||||
"connect-history-api-fallback": "^1.6.0",
|
"connect-history-api-fallback": "^1.6.0",
|
||||||
"convict": "^5.0.0",
|
"convict": "^5.0.0",
|
||||||
|
|
|
@ -7,6 +7,7 @@ import {
|
||||||
getConnectionManager,
|
getConnectionManager,
|
||||||
} from 'typeorm';
|
} from 'typeorm';
|
||||||
import * as bodyParser from 'body-parser';
|
import * as bodyParser from 'body-parser';
|
||||||
|
require('body-parser-xml')(bodyParser);
|
||||||
import * as history from 'connect-history-api-fallback';
|
import * as history from 'connect-history-api-fallback';
|
||||||
import * as requestPromise from 'request-promise-native';
|
import * as requestPromise from 'request-promise-native';
|
||||||
|
|
||||||
|
@ -235,6 +236,14 @@ class App {
|
||||||
req.rawBody = buf;
|
req.rawBody = buf;
|
||||||
}}));
|
}}));
|
||||||
|
|
||||||
|
// Support application/xml type post data
|
||||||
|
// @ts-ignore
|
||||||
|
this.app.use(bodyParser.xml({ limit: "16mb", xmlParseOptions: {
|
||||||
|
normalize: true, // Trim whitespace inside text nodes
|
||||||
|
normalizeTags: true, // Transform tags to lowercase
|
||||||
|
explicitArray: false // Only put properties in array if length > 1
|
||||||
|
} }));
|
||||||
|
|
||||||
// Make sure that Vue history mode works properly
|
// Make sure that Vue history mode works properly
|
||||||
this.app.use(history({
|
this.app.use(history({
|
||||||
rewrites: [
|
rewrites: [
|
||||||
|
|
Loading…
Reference in a new issue