Skip to content

Commit 879d3cd

Browse files
committed
fix: grpc path should start with http(s)
1 parent a4f5f89 commit 879d3cd

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

go/internal/feast/registry/grpc.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ func buildTLSCredentials(certPath string) (credentials.TransportCredentials, err
8181
// parseGrpcTarget strips grpc:// or grpcs:// scheme prefixes and returns
8282
// the target address along with whether TLS should be used.
8383
func parseGrpcTarget(path string) (target string, useTLS bool) {
84-
if strings.HasPrefix(path, "grpcs://") {
85-
return strings.TrimPrefix(path, "grpcs://"), true
84+
if strings.HasPrefix(path, "https://") {
85+
return strings.TrimPrefix(path, "https://"), true
8686
}
87-
if strings.HasPrefix(path, "grpc://") {
88-
return strings.TrimPrefix(path, "grpc://"), false
87+
if strings.HasPrefix(path, "http://") {
88+
return strings.TrimPrefix(path, "http://"), false
8989
}
9090
return path, false
9191
}

go/internal/feast/registry/grpc_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,12 @@ func TestGrpcTeardown(t *testing.T) {
175175

176176
func TestParseGrpcTarget(t *testing.T) {
177177
cases := []struct {
178-
input string
179-
target string
180-
useTLS bool
178+
input string
179+
target string
180+
useTLS bool
181181
}{
182-
{"grpc://host:50051", "host:50051", false},
183-
{"grpcs://host:50051", "host:50051", true},
182+
{"http://host:50051", "host:50051", false},
183+
{"https://host:50051", "host:50051", true},
184184
{"host:50051", "host:50051", false},
185185
}
186186
for _, c := range cases {

0 commit comments

Comments
 (0)