@@ -10,7 +10,6 @@ import (
1010 "log"
1111 "net/http"
1212 "net/url"
13- "strconv"
1413 "time"
1514
1615 "github.com/hashicorp/go-retryablehttp"
@@ -64,7 +63,7 @@ func createNewRequest(method, url string, body io.Reader, accessID string, acces
6463func logRequestAndResponse (req * http.Request , resp * http.Response ) {
6564 var maskedHeader = req .Header .Clone ()
6665 maskedHeader .Set ("Authorization" , "xxxxxxxxxxx" )
67- log .Printf ("[DEBUG] Request: [Method=%s] [URL=%s] [Headers=%s]. Response: [Status=%s] [Number of Retries=%s] \n " , req .Method , req .URL , maskedHeader , resp .Status , resp . Header . Get ( "numberOfRetries" ) )
66+ log .Printf ("[DEBUG] Request: [Method=%s] [URL=%s] [Headers=%s]. Response: [Status=%s]\n " , req .Method , req .URL , maskedHeader , resp .Status )
6867}
6968
7069func (s * Client ) PostWithCookies (urlPath string , payload interface {}) ([]byte , []* http.Cookie , error ) {
@@ -331,7 +330,6 @@ func (s *Client) Delete(urlPath string) ([]byte, error) {
331330
332331func ErrorHandler (resp * http.Response , err error , numTries int ) (* http.Response , error ) {
333332 log .Printf ("[ERROR] Request %s failed after %d attempts with response: [%s]" , resp .Request .URL , numTries , resp .Status )
334- resp .Header .Add ("numberOfRetries" , strconv .Itoa (numTries ))
335333 return resp , err
336334}
337335
0 commit comments