File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -122,8 +122,6 @@ func (c *Client) R(ctx context.Context) *resty.Request {
122
122
func (c * Client ) SetDebug (debug bool ) * Client {
123
123
c .debug = debug
124
124
c .resty .SetDebug (debug )
125
- // this ensures that if there is an Authorization header present, the value is sanitized/masked
126
- c .sanitizeAuthorizationHeader ()
127
125
128
126
return c
129
127
}
@@ -414,12 +412,14 @@ func (c *Client) SetHeader(name, value string) {
414
412
c .resty .SetHeader (name , value )
415
413
}
416
414
417
- func (c * Client ) sanitizeAuthorizationHeader () {
415
+ func (c * Client ) enableLogSanitization () * Client {
418
416
c .resty .OnRequestLog (func (r * resty.RequestLog ) error {
419
417
// masking authorization header
420
418
r .Header .Set ("Authorization" , "Bearer *******************************" )
421
419
return nil
422
420
})
421
+
422
+ return c
423
423
}
424
424
425
425
// NewClient factory to create new Client struct
@@ -468,7 +468,8 @@ func NewClient(hc *http.Client) (client Client) {
468
468
SetRetryWaitTime (APISecondsPerPoll * time .Second ).
469
469
SetPollDelay (APISecondsPerPoll * time .Second ).
470
470
SetRetries ().
471
- SetDebug (envDebug )
471
+ SetDebug (envDebug ).
472
+ enableLogSanitization ()
472
473
473
474
return
474
475
}
You can’t perform that action at this time.
0 commit comments