MCPcopy Create free account
hub / github.com/prometheus/common / NewUserAgentRoundTripper

Function NewUserAgentRoundTripper

config/http_config.go:1172–1174  ·  view source on GitHub ↗

NewUserAgentRoundTripper adds the user agent every request header.

(userAgent string, rt http.RoundTripper)

Source from the content-addressed store, hash-verified

1170
1171// NewUserAgentRoundTripper adds the user agent every request header.
1172func NewUserAgentRoundTripper(userAgent string, rt http.RoundTripper) http.RoundTripper {
1173 return &userAgentRoundTripper{userAgent, rt}
1174}
1175
1176func (rt *userAgentRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
1177 req = cloneRequest(req)

Callers 2

RoundTripMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected