🐛 Fix SNS-Trigger-Node

This commit is contained in:
Jan Oberhauser
2020-02-09 18:27:06 -08:00
parent ca047b9c78
commit 3fe236b9e6
3 changed files with 45 additions and 27 deletions

View File

@@ -231,19 +231,28 @@ class App {
});
// Support application/json type post data
this.app.use(bodyParser.json({ limit: "16mb", verify: (req, res, buf) => {
// @ts-ignore
req.rawBody = buf;
}}));
this.app.use(bodyParser.json({
limit: '16mb', verify: (req, res, buf) => {
// @ts-ignore
req.rawBody = buf;
}
}));
// Support application/xml type post data
// @ts-ignore
this.app.use(bodyParser.xml({ limit: "16mb", xmlParseOptions: {
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
explicitArray: false, // Only put properties in array if length > 1
} }));
this.app.use(bodyParser.text({
limit: '16mb', verify: (req, res, buf) => {
// @ts-ignore
req.rawBody = buf;
}
}));
// Make sure that Vue history mode works properly
this.app.use(history({
rewrites: [