File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ var _ = require('underscore');
7
7
var chalk = require ( './chalk' ) ;
8
8
var config = require ( './config' ) ;
9
9
var icon = require ( './icon' ) ;
10
+ var h = require ( './helper' ) ;
10
11
11
12
// We are expecting a tier configuration like:
12
13
// global config < local config < cli params
@@ -57,14 +58,13 @@ function setLogLevel() {
57
58
args . unshift ( '[TRACE]' ) ;
58
59
}
59
60
console . log . apply ( null , _ . map ( args , function ( arg ) {
60
- return chalk . gray ( arg ) ;
61
+ return chalk . gray ( h . printSafeHTTP ( arg ) ) ;
61
62
} ) ) ;
62
63
} ) ;
63
64
}
64
65
}
65
66
66
67
function checkCache ( ) {
67
- var h = require ( './helper' ) ;
68
68
var cacheDir = h . getCacheDir ( ) ;
69
69
70
70
if ( ! fs . existsSync ( cacheDir ) )
Original file line number Diff line number Diff line change @@ -165,4 +165,10 @@ h.getSetCookieValue = function(resp, key) {
165
165
return null ;
166
166
} ;
167
167
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
+
168
174
module . exports = h ;
You can’t perform that action at this time.
0 commit comments