diff --git a/backend/routes/clickTtHttpPageRoutes.js b/backend/routes/clickTtHttpPageRoutes.js index 3fc0649d..df038332 100644 --- a/backend/routes/clickTtHttpPageRoutes.js +++ b/backend/routes/clickTtHttpPageRoutes.js @@ -45,6 +45,10 @@ function serializeFormBody(req) { return req.rawBody; } + if (Buffer.isBuffer(req.body) && req.body.length > 0) { + return req.body.toString('utf8'); + } + if (typeof req.body === 'string') { return req.body; } diff --git a/backend/server.js b/backend/server.js index 823ad307..6822009c 100644 --- a/backend/server.js +++ b/backend/server.js @@ -75,6 +75,11 @@ app.use(cors({ allowedHeaders: ['Content-Type', 'Authorization', 'authcode', 'userid'] })); +app.use('/api/clicktt/proxy', express.raw({ + type: ['multipart/form-data', 'application/octet-stream'], + limit: '5mb', + verify: captureRawBody, +})); app.use(express.json({ verify: captureRawBody })); app.use(express.urlencoded({ extended: true, verify: captureRawBody }));