Datasource: Fix allowed cookies to be forwarded as header to backend datasources (#49541)

Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
This commit is contained in:
Marcus Efraimsson
2022-05-31 17:02:58 +02:00
committed by GitHub
parent e82784bff0
commit 1196b4a609
4 changed files with 62 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package dtos
import (
"crypto/md5"
"fmt"
"net/http"
"regexp"
"strings"
@ -68,6 +69,8 @@ type MetricRequest struct {
Queries []*simplejson.Json `json:"queries"`
// required: false
Debug bool `json:"debug"`
HTTPRequest *http.Request `json:"-"`
}
func GetGravatarUrl(text string) string {

View File

@ -44,6 +44,8 @@ func (hs *HTTPServer) QueryMetricsV2(c *models.ReqContext) response.Response {
return response.Error(http.StatusBadRequest, "bad request data", err)
}
reqDTO.HTTPRequest = c.Req
resp, err := hs.queryDataService.QueryData(c.Req.Context(), c.SignedInUser, c.SkipCache, reqDTO, true)
if err != nil {
return hs.handleQueryMetricsError(err)