mirror of
https://github.com/grafana/grafana.git
synced 2025-08-06 05:30:12 +08:00
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:

committed by
GitHub

parent
e82784bff0
commit
1196b4a609
@ -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 {
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user