You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by xi...@apache.org on 2021/10/03 06:49:04 UTC

[dubbo-go-pixiu] branch develop updated: fix: grpc config cross-platform file path support (#266)

This is an automated email from the ASF dual-hosted git repository.

xiaoliu pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/dubbo-go-pixiu.git


The following commit(s) were added to refs/heads/develop by this push:
     new 5409b43  fix: grpc config cross-platform file path support (#266)
5409b43 is described below

commit 5409b4390679cdc7cdb9aa9d6bfed04ce2f0507f
Author: MasterKenway <40...@users.noreply.github.com>
AuthorDate: Sun Oct 3 14:48:58 2021 +0800

    fix: grpc config cross-platform file path support (#266)
    
    Co-authored-by: Xin.Zh <dr...@foxmail.com>
---
 pkg/filter/http/grpcproxy/grpc.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkg/filter/http/grpcproxy/grpc.go b/pkg/filter/http/grpcproxy/grpc.go
index 04144d8..4b165c5 100644
--- a/pkg/filter/http/grpcproxy/grpc.go
+++ b/pkg/filter/http/grpcproxy/grpc.go
@@ -328,12 +328,12 @@ func (f *Filter) Apply() error {
 	gc := f.cfg
 
 	cur := gc.Path
-	if len(cur) != 0 && cur[0] != '/' {
+	if !filepath.IsAbs(cur) {
 		ex, err := os.Executable()
 		if err != nil {
 			return err
 		}
-		cur = filepath.Dir(ex) + "/" + gc.Path
+		cur = filepath.Dir(ex) + string(os.PathSeparator) + gc.Path
 	}
 
 	logger.Infof("%s load proto files from %s", loggerHeader, cur)