From a53d111e5635d8e7ed666819abdc25e075aee8e3 Mon Sep 17 00:00:00 2001 From: quansenB Date: Mon, 9 Dec 2019 01:07:57 +0100 Subject: [PATCH] add xml body parser for xml webhook support --- packages/cli/package.json | 1 + packages/cli/src/Server.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/packages/cli/package.json b/packages/cli/package.json index f13f6c422c..386db9862d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -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", diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index 3a85221388..0593611244 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -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: [