From 5d2ee1ec4899e8f4ff0e0f54bb16ac745df6d144 Mon Sep 17 00:00:00 2001 From: Mike Bland Date: Mon, 22 Jun 2015 09:59:27 -0400 Subject: [PATCH] Pass through bodyParser.json() middleware options 18F/pages is a Hookshot server for https://pages.18f.gov/. Recently, as noted in 18F/pages#14, the default 100KB payload limit was exceeded by a webhook fired for 18F/govt-wide-patternlibrary#54. This change will allow us to pass options through to the bodyParser.json() middleware to increase the limit. --- lib/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 1c84390..d72cf0a 100644 --- a/lib/index.js +++ b/lib/index.js @@ -3,14 +3,14 @@ var normalize = require('path').normalize; var spawn = require('child_process').spawn; var express = require('express'); -module.exports = function (ref, action) { +module.exports = function (ref, action, body_parser_json_options) { // create express instance var hookshot = express(); // middleware hookshot.use(bodyParser.urlencoded({ extended: false })); - hookshot.use(bodyParser.json()); + hookshot.use(bodyParser.json(body_parser_json_options)); // main POST handler hookshot.post('/', function (req, res, next) {