From 34bb4f80ed370e29f130c4323e23f20db7462679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20Villaf=C3=A1=C3=B1ez?= Date: Wed, 20 Dec 2023 11:57:05 +0100 Subject: [PATCH] fix: double quotes will be trimmed from the search token --- services/graph/pkg/identity/odata.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/services/graph/pkg/identity/odata.go b/services/graph/pkg/identity/odata.go index 3b9e5a9b67..556cdcfed0 100644 --- a/services/graph/pkg/identity/odata.go +++ b/services/graph/pkg/identity/odata.go @@ -1,6 +1,10 @@ package identity -import "github.com/CiscoM31/godata" +import ( + "strings" + + "github.com/CiscoM31/godata" +) // GetExpandValues extracts the values of the $expand query parameter and // returns them in a []string, rejects any $expand value that consists of more @@ -37,5 +41,9 @@ func GetSearchValues(req *godata.GoDataQuery) (string, error) { return "", godata.NotImplementedError("complex search queries are not supported") } - return req.Search.Tree.Token.Value, nil + searchValue := req.Search.Tree.Token.Value + if strings.HasPrefix(searchValue, "\"") && strings.HasSuffix(searchValue, "\"") { + searchValue = strings.Trim(searchValue, "\"") + } + return searchValue, nil }