fix path miss in windows/add a new api create function (#23)
* fix path was not always correct in windows * add new api create function for if the port was different with api file. * Update api.go remove no need commit This commit was moved from ipfs/go-ipfs-http-client@8c87debb1233f2af7a0cd102a934b630d8a12147
godcong committed
Aug 13, 2019 at 07:16 UTC
be8f80237d4ba8ed8d2ef278180b2b3d446c60f0
1 file changed
+3
-3
client/httpapi/api.go
+3
-3
@@ -7,12 +7,12 @@ import (
7
"net/http"
8
gohttp "net/http"
9
"os"
10
- "path"
10
+ "path/filepath"
11
"strings"
12
13
iface "github.com/ipfs/interface-go-ipfs-core"
14
caopts "github.com/ipfs/interface-go-ipfs-core/options"
15
- homedir "github.com/mitchellh/go-homedir"
15
+ "github.com/mitchellh/go-homedir"
16
ma "github.com/multiformats/go-multiaddr"
17
manet "github.com/multiformats/go-multiaddr-net"
18
)
@@ -73,7 +73,7 @@ func ApiAddr(ipfspath string) (ma.Multiaddr, error) {
73
return nil, err
74
}
75
76
- apiFile := path.Join(baseDir, DefaultApiFile)
76
+ apiFile := filepath.Join(baseDir, DefaultApiFile)
77
78
api, err := ioutil.ReadFile(apiFile)
79
if err != nil {