From f05e08a76750d1f8459b75a3b8f1461f54e4aa1c Mon Sep 17 00:00:00 2001 From: Jason Song Date: Wed, 23 Nov 2022 11:42:02 +0800 Subject: [PATCH] chore: update grpc router path --- client/http.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/http.go b/client/http.go index 6e8ced5..b0b1e75 100644 --- a/client/http.go +++ b/client/http.go @@ -4,6 +4,7 @@ import ( "crypto/tls" "net" "net/http" + "strings" "time" "code.gitea.io/bots-proto-go/ping/v1/pingv1connect" @@ -51,15 +52,17 @@ func New(endpoint string, opts ...Option) *HTTPClient { } } + baseURL := strings.TrimRight(endpoint, "/") + "/api/bots" + return &HTTPClient{ PingServiceClient: pingv1connect.NewPingServiceClient( cfg.httpClient, - endpoint, + baseURL, cfg.opts..., ), RunnerServiceClient: runnerv1connect.NewRunnerServiceClient( cfg.httpClient, - endpoint, + baseURL, cfg.opts..., ), endpoint: endpoint,