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

This commit is contained in:
Ryan McKinley 2022-11-18 10:46:50 +00:00 committed by GitHub
parent 0e4108f62f
commit 8e19a1618f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

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) {

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")