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 {
122122func (c * Client ) SetDebug (debug bool ) * Client {
123123 c .debug = debug
124124 c .resty .SetDebug (debug )
125- // this ensures that if there is an Authorization header present, the value is sanitized/masked
126- c .sanitizeAuthorizationHeader ()
127125
128126 return c
129127}
@@ -414,12 +412,14 @@ func (c *Client) SetHeader(name, value string) {
414412 c .resty .SetHeader (name , value )
415413}
416414
417- func (c * Client ) sanitizeAuthorizationHeader () {
415+ func (c * Client ) enableLogSanitization () * Client {
418416 c .resty .OnRequestLog (func (r * resty.RequestLog ) error {
419417 // masking authorization header
420418 r .Header .Set ("Authorization" , "Bearer *******************************" )
421419 return nil
422420 })
421+
422+ return c
423423}
424424
425425// NewClient factory to create new Client struct
@@ -468,7 +468,8 @@ func NewClient(hc *http.Client) (client Client) {
468468 SetRetryWaitTime (APISecondsPerPoll * time .Second ).
469469 SetPollDelay (APISecondsPerPoll * time .Second ).
470470 SetRetries ().
471- SetDebug (envDebug )
471+ SetDebug (envDebug ).
472+ enableLogSanitization ()
472473
473474 return
474475}
You can’t perform that action at this time.
0 commit comments