mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 16:15:42 -06:00
Propagate all headers on main QueryData (#56896)
This commit is contained in:
parent
1ca5c347d3
commit
145b970557
@ -173,24 +173,10 @@ func (s *Service) QueryData(ctx context.Context, req *backend.QueryDataRequest)
|
||||
return queryData(ctx, req, dsInfo, s.plog, s.tracer)
|
||||
}
|
||||
|
||||
func getAuthHeadersForQueryData(headers map[string]string) map[string]string {
|
||||
data := make(map[string]string)
|
||||
|
||||
if auth := headers["Authorization"]; auth != "" {
|
||||
data["Authorization"] = auth
|
||||
}
|
||||
|
||||
if cookie := headers["Cookie"]; cookie != "" {
|
||||
data["Cookie"] = cookie
|
||||
}
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
func queryData(ctx context.Context, req *backend.QueryDataRequest, dsInfo *datasourceInfo, plog log.Logger, tracer tracing.Tracer) (*backend.QueryDataResponse, error) {
|
||||
result := backend.NewQueryDataResponse()
|
||||
|
||||
api := newLokiAPI(dsInfo.HTTPClient, dsInfo.URL, plog, getAuthHeadersForQueryData(req.Headers))
|
||||
api := newLokiAPI(dsInfo.HTTPClient, dsInfo.URL, plog, req.Headers)
|
||||
|
||||
queries, err := parseQuery(req)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user