(r *http.Response, buf []byte, resp *PrometheusResponse)
| 798 | } |
| 799 | |
| 800 | func UnmarshalResponse(r *http.Response, buf []byte, resp *PrometheusResponse) error { |
| 801 | if r.Header == nil { |
| 802 | return json.Unmarshal(buf, resp) |
| 803 | } |
| 804 | |
| 805 | contentType := r.Header.Get("Content-Type") |
| 806 | if contentType == ApplicationProtobuf || contentType == QueryResponseCortexMIMEType { |
| 807 | return proto.Unmarshal(buf, resp) |
| 808 | } else { |
| 809 | return json.Unmarshal(buf, resp) |
| 810 | } |
| 811 | } |
no test coverage detected