allow whitespaces in contains & startsWith Filter

Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
Christian Richter
2023-12-01 11:28:40 +01:00
parent a7d2ef2507
commit fb514c2ff1

View File

@@ -73,7 +73,7 @@ func (g Graph) applyFilterFunctionStartsWith(ctx context.Context, req *godata.Go
switch operand1.Token.Value {
case "displayName":
var retUsers []*libregraph.User
filterValue := operand2.Token.Value
filterValue := strings.Trim(operand2.Token.Value, "'")
logger.Debug().Str("property", operand2.Token.Value).Str("value", filterValue).Msg("Filtering displayName by startsWith")
if users, err := g.identityBackend.GetUsers(ctx, req); err == nil {
for _, user := range users {
@@ -99,7 +99,7 @@ func (g Graph) applyFilterFunctionContains(ctx context.Context, req *godata.GoDa
switch operand1.Token.Value {
case "displayName":
var retUsers []*libregraph.User
filterValue := operand2.Token.Value
filterValue := strings.Trim(operand2.Token.Value, "'")
logger.Debug().Str("property", operand2.Token.Value).Str("value", filterValue).Msg("Filtering displayName by contains")
if users, err := g.identityBackend.GetUsers(ctx, req); err == nil {
for _, user := range users {