Skip to content

Commit 2561439

Browse files
committed
SUMO-228138: Removing number of retries from response header.
1 parent 92523af commit 2561439

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

sumologic/sumologic_client.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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
6463
func 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

7069
func (s *Client) PostWithCookies(urlPath string, payload interface{}) ([]byte, []*http.Cookie, error) {
@@ -331,7 +330,6 @@ func (s *Client) Delete(urlPath string) ([]byte, error) {
331330

332331
func 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

Comments
 (0)