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 <[email protected]>
AuthorDate: Sun Oct 3 14:48:58 2021 +0800

    fix: grpc config cross-platform file path support (#266)
    
    Co-authored-by: Xin.Zh <[email protected]>
---
 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)

Reply via email to