add xml body parser for xml webhook support

This commit is contained in:
quansenB 2019-12-09 01:07:57 +01:00
parent 366fe861ca
commit a53d111e56
2 changed files with 6 additions and 0 deletions

View file

@ -76,6 +76,7 @@
"@oclif/errors": "^1.2.2",
"basic-auth": "^2.0.1",
"body-parser": "^1.18.3",
"body-parser-xml": "^1.1.0",
"compression": "^1.7.4",
"connect-history-api-fallback": "^1.6.0",
"convict": "^5.0.0",

View file

@ -7,6 +7,7 @@ import {
getConnectionManager,
} from 'typeorm';
import * as bodyParser from 'body-parser';
require('body-parser-xml')(bodyParser);
import * as history from 'connect-history-api-fallback';
import * as requestPromise from 'request-promise-native';
@ -232,6 +233,10 @@ class App {
// Support application/json type post data
this.app.use(bodyParser.json({ limit: "16mb" }));
// Support application/xml type post data
// @ts-ignore
this.app.use(bodyParser.xml({ limit: "16mb" }));
// Make sure that Vue history mode works properly
this.app.use(history({
rewrites: [