diff --git a/pkg/frontend/transport/handler.go b/pkg/frontend/transport/handler.go index 042dbd32b7..700145312f 100644 --- a/pkg/frontend/transport/handler.go +++ b/pkg/frontend/transport/handler.go @@ -200,7 +200,6 @@ func (f *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { r.Body = io.NopCloser(&buf) } - r.Header.Get("test") startTime := time.Now() resp, err := f.roundTripper.RoundTrip(r) queryResponseTime := time.Since(startTime) diff --git a/pkg/querier/tripperware/priority.go b/pkg/querier/tripperware/priority.go index 5ce4e0d3fa..b96a3b0e9a 100644 --- a/pkg/querier/tripperware/priority.go +++ b/pkg/querier/tripperware/priority.go @@ -88,7 +88,7 @@ func isWithinTimeAttributes(attribute validation.QueryAttribute, now time.Time, } func FindMinMaxTime(s *parser.EvalStmt) (int64, int64) { - // Placeholder until Prometheus is updated to >=0.48.0 - // which includes https://github.com/prometheus/prometheus/commit/9e3df532d8294d4fe3284bde7bc96db336a33552 + // Placeholder until Prometheus is updated to include + // https://github.com/prometheus/prometheus/commit/9e3df532d8294d4fe3284bde7bc96db336a33552 return s.Start.Unix(), s.End.Unix() } diff --git a/pkg/util/httpgrpcutil/header.go b/pkg/util/httpgrpcutil/header.go index b844e0c65f..ed453f01fa 100644 --- a/pkg/util/httpgrpcutil/header.go +++ b/pkg/util/httpgrpcutil/header.go @@ -7,7 +7,12 @@ import ( // GetHeader is similar to http.Header.Get, which gets the first value associated with the given key. // If there are no values associated with the key, it returns "". func GetHeader(r httpgrpc.HTTPRequest, key string) string { - return GetHeaderValues(r, key)[0] + values := GetHeaderValues(r, key) + if len(values) == 0 { + return "" + } + + return values[0] } // GetHeaderValues is similar to http.Header.Values, which returns all values associated with the given key.