diff --git a/lib/server.js b/lib/server.js index 4de3d23..d88457b 100644 --- a/lib/server.js +++ b/lib/server.js @@ -32,6 +32,17 @@ module.exports = (testRoute) => { app.use(require('express-sslify').HTTPS({ trustProtoHeader: true })) } + app.use((req, res, next) => { + var buf = '' + req.on('data', (chunk) => { + buf += chunk + }) + req.on('end', () => { + req.rawdata = buf + }) + next() + }) + app.use(cors()) app.use(express.json()) app.use(express.urlencoded({ extended: true })) @@ -100,6 +111,7 @@ module.exports = (testRoute) => { payload: { ...req.headers, body: req.body, + rawdata: req.rawdata, query: req.query, timestamp: Date.now() }