Merge pull request #514 from yaohcn/feat/specific-ipfs-gateway

feat: specific ipfs gateway
This commit is contained in:
Jakub Sztandera 2019-10-31 14:15:28 +01:00 committed by GitHub
commit e0efc770b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -117,9 +117,13 @@ func (ft *fetch) wait() error {
}
func doFetch(out string, info paramFile) error {
log.Infof("Fetching %s", out)
gw := os.Getenv("IPFS_GATEWAY")
if gw == "" {
gw = gateway
}
log.Infof("Fetching %s from %s", out, gw)
resp, err := http.Get(gateway + info.Cid)
resp, err := http.Get(gw + info.Cid)
if err != nil {
return err
}