From 893546f58c5ea99ddaa0904623190b6463a4feb6 Mon Sep 17 00:00:00 2001 From: Gianmaria Del Monte Date: Fri, 22 Oct 2021 17:47:08 +0200 Subject: [PATCH] Fix grpc user agent check --- pkg/storage/registry/static/static.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/storage/registry/static/static.go b/pkg/storage/registry/static/static.go index c01a6ad1b8..d5d84403e4 100644 --- a/pkg/storage/registry/static/static.go +++ b/pkg/storage/registry/static/static.go @@ -153,7 +153,7 @@ func userAgentIsAllowed(ua *ua.UserAgent, userAgents []string) bool { return true } case "grpc": - if ua.Name == "grpc-go" { + if strings.HasPrefix(ua.Name, "grpc") { return true } } @@ -170,7 +170,6 @@ func (b *reg) FindProviders(ctx context.Context, ref *provider.Reference) ([]*re if ref.ResourceId != nil { if ref.ResourceId.StorageId != "" { for prefix, rule := range b.c.Rules { - addr := getProviderAddr(ctx, rule) r, err := regexp.Compile("^" + prefix + "$") if err != nil {