QueryData: fix header parsing to support expressions (#58826)

fixes #58821
This commit is contained in:
Ryan McKinley
2022-11-16 10:17:24 -05:00
committed by GitHub
parent 9a5a344304
commit 934fb2f0ee
2 changed files with 16 additions and 0 deletions
+8
View File
@@ -259,6 +259,14 @@ func (pr parsedRequest) validateRequest() error {
return nil
}
if pr.hasExpression {
hasExpr := pr.httpRequest.URL.Query().Get("expression")
if hasExpr == "" || hasExpr == "true" {
return nil
}
return ErrQueryParamMismatch
}
vals := splitHeaders(pr.httpRequest.Header.Values(HeaderDatasourceUID))
count := len(vals)
if count > 0 { // header exists