(cherry picked from commit 145b970557)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
This commit is contained in:
co-authored by
Alexander Weaver
parent
22ae442f56
commit
b00bb90926
+1
-15
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user