File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ var _ = require('underscore');
77var chalk = require ( './chalk' ) ;
88var config = require ( './config' ) ;
99var icon = require ( './icon' ) ;
10+ var h = require ( './helper' ) ;
1011
1112// We are expecting a tier configuration like:
1213// global config < local config < cli params
@@ -57,14 +58,13 @@ function setLogLevel() {
5758 args . unshift ( '[TRACE]' ) ;
5859 }
5960 console . log . apply ( null , _ . map ( args , function ( arg ) {
60- return chalk . gray ( arg ) ;
61+ return chalk . gray ( h . printSafeHTTP ( arg ) ) ;
6162 } ) ) ;
6263 } ) ;
6364 }
6465}
6566
6667function checkCache ( ) {
67- var h = require ( './helper' ) ;
6868 var cacheDir = h . getCacheDir ( ) ;
6969
7070 if ( ! fs . existsSync ( cacheDir ) )
Original file line number Diff line number Diff line change @@ -165,4 +165,10 @@ h.getSetCookieValue = function(resp, key) {
165165 return null ;
166166} ;
167167
168+ h . printSafeHTTP = function ( msg ) {
169+ return msg . replace ( / ( C o o k i e \s * : \s * ) ' .* ?' / , '$1<hidden>' )
170+ . replace ( / ( ' X - C S R F T o k e n ' \s * : \s * ) ' .* ?' / , '$1<hidden>' )
171+ . replace ( / ( ' s e t - c o o k i e ' \s * : \s * ) \[ .* ?\] / , '$1<hidden>' ) ;
172+ } ;
173+
168174module . exports = h ;
You can’t perform that action at this time.
0 commit comments