Skip to content

Commit

Permalink
proxyReq=OutgoingMessage, remove cookies if found
Browse files Browse the repository at this point in the history
  • Loading branch information
kenglxn committed Oct 2, 2023
1 parent 879fae0 commit a2ccd69
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ const log = new Proxy(

const cookieScraperPlugin = (proxyServer, options) => {
proxyServer.on('proxyReq', (proxyReq, req, res, options) => {
if (proxyReq.header['cookie']) {
log.info('removing cookie from proxyReq. size=', proxyReq.header['cookie'].size);
delete proxyReq.header['cookie'];
if (proxyReq.getHeader('cookie')) {
proxyReq.removeHeader('cookie');
}
});
};
Expand Down

0 comments on commit a2ccd69

Please sign in to comment.