From 85fb9b7bde03eef3e2d0e853fccc0c08465fca58 Mon Sep 17 00:00:00 2001 From: Johnny Niklasson Date: Thu, 16 May 2024 09:29:36 +0200 Subject: [PATCH] log headers but remove authorization because it would log the token (#258) --- server.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server.js b/server.js index a35a9bc..bb99ee9 100644 --- a/server.js +++ b/server.js @@ -18,9 +18,16 @@ app.use( '/api', proxy(DAPLA_TEAM_API_URL, { proxyReqBodyDecorator: function (bodyContent, srcReq) { + console.log(`Request Body: ${bodyContent}`) return bodyContent }, proxyReqOptDecorator: function (proxyReqOpts, srcReq) { + const headers = srcReq.headers + delete headers['authorization'] + console.log(`Request Headers:`, headers) + if (srcReq.body) { + console.log(`Request Body:`, srcReq.body) + } return proxyReqOpts }, proxyReqPathResolver: function (req) {