Skip to content

Commit

Permalink
Do not modify original request in roundtripper
Browse files Browse the repository at this point in the history
  • Loading branch information
Aline Abler committed Feb 27, 2023
1 parent 8059f68 commit 1802d61
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/thanos/thanos.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ type AdditionalHeadersRoundTripper struct {

// RoundTrip implements the RoundTripper interface.
func (t *PartialResponseRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
q := req.URL.Query()
r2 := new(http.Request)
*r2 = *req
q := r2.URL.Query()
q.Set("partial_response", strconv.FormatBool(t.Allow))
req.URL.RawQuery = q.Encode()
r2.URL.RawQuery = q.Encode()
req = r2
return t.RoundTripper.RoundTrip(req)
}

Expand Down

0 comments on commit 1802d61

Please sign in to comment.