[v9.3.x] QueryData: skip header validation (revert check) (#58946)

QueryData: skip header validation (revert check) (#58871)

(cherry picked from commit 8e19a1618f)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
Grot (@grafanabot)
2022-11-18 05:59:50 -05:00
committed by GitHub
co-authored by Ryan McKinley
parent 4db1f3b850
commit d7e459fdee
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -372,7 +372,8 @@ func (s *Service) parseMetricRequest(ctx context.Context, user *user.SignedInUse
req.httpRequest = reqDTO.HTTPRequest
}
return req, req.validateRequest()
_ = req.validateRequest()
return req, nil // TODO req.validateRequest()
}
func (s *Service) getDataSourceFromQuery(ctx context.Context, user *user.SignedInUser, skipCache bool, query *simplejson.Json, history map[string]*datasources.DataSource) (*datasources.DataSource, error) {
+1 -1
View File
@@ -189,7 +189,7 @@ func TestParseMetricRequest(t *testing.T) {
httpreq.Header.Add("X-Datasource-Uid", "gIEkMvIVz")
mr.HTTPRequest = httpreq
_, err := tc.queryService.parseMetricRequest(context.Background(), tc.signedInUser, true, mr)
require.Error(t, err)
require.NoError(t, err)
// With the second value it is OK
httpreq.Header.Add("X-Datasource-Uid", "sEx6ZvSVk")