Skip to content

Commit

Permalink
log headers but remove authorization because it would log the token (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ssb-jnk authored May 16, 2024
1 parent 11e6245 commit 85fb9b7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 85fb9b7

Please sign in to comment.