@@ -658,7 +658,7 @@ func (c *Client) Do(req *Request) (*http.Response, error) {
658658	if  logger  !=  nil  {
659659		switch  v  :=  logger .(type ) {
660660		case  LeveledLogger :
661- 			v .Debug ("performing request" , "method" , req .Method , "url" , redactURL ( req .URL ) )
661+ 			v .Debug ("performing request" , "method" , req .Method , "url" , redactedURL { req .URL } )
662662		case  Logger :
663663			v .Printf ("[DEBUG] %s %s" , req .Method , redactURL (req .URL ))
664664		}
@@ -715,7 +715,7 @@ func (c *Client) Do(req *Request) (*http.Response, error) {
715715		if  err  !=  nil  {
716716			switch  v  :=  logger .(type ) {
717717			case  LeveledLogger :
718- 				v .Error ("request failed" , "error" , err , "method" , req .Method , "url" , redactURL ( req .URL ) )
718+ 				v .Error ("request failed" , "error" , err , "method" , req .Method , "url" , redactedURL { req .URL } )
719719			case  Logger :
720720				v .Printf ("[ERR] %s %s request failed: %v" , req .Method , redactURL (req .URL ), err )
721721			}
@@ -910,16 +910,3 @@ func (c *Client) StandardClient() *http.Client {
910910	}
911911}
912912
913- // Taken from url.URL#Redacted() which was introduced in go 1.15. 
914- // We can switch to using it directly if we'll bump the minimum required go version. 
915- func  redactURL (u  * url.URL ) string  {
916- 	if  u  ==  nil  {
917- 		return  "" 
918- 	}
919- 
920- 	ru  :=  * u 
921- 	if  _ , has  :=  ru .User .Password (); has  {
922- 		ru .User  =  url .UserPassword (ru .User .Username (), "xxxxx" )
923- 	}
924- 	return  ru .String ()
925- }
0 commit comments