From 00aabcae0ebe5a1f9232b5cbfac76549bafffb1a Mon Sep 17 00:00:00 2001 From: MaksimFalei Date: Mon, 4 Jan 2021 18:33:07 +0300 Subject: [PATCH] Fixes an issue when the basic webhook receiver was responding with the 404 error code. --- basic/server.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/basic/server.js b/basic/server.js index 59989a9..f325630 100644 --- a/basic/server.js +++ b/basic/server.js @@ -14,6 +14,10 @@ const app = express(); app.use(bodyParser.urlencoded({extended: true})); app.use(bodyParser.json()); app.use(methodOverride('X-HTTP-Method-Override')); +app.use((req, res, next) => { + res.setHeader('Content-Type', req.headers['content-type']); + next(); +}); // Add Basic authentication to our API. app.use((req, res, next) => { @@ -45,4 +49,9 @@ app.delete('/*', (req, res, next) => { next(); }); +// Add basic response +app.use((req, res) => { + res.send({}); +}); + module.exports = app;