mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 09:59:13 +08:00
daemon: only try gateway addr if there
This commit is contained in:
@ -111,11 +111,14 @@ func daemonFunc(req cmds.Request) (interface{}, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore error for gateway address
|
var gatewayMaddr ma.Multiaddr
|
||||||
// if there is an error (invalid address), then don't run the gateway
|
if len(cfg.Addresses.Gateway) > 0 {
|
||||||
gatewayMaddr, _ := ma.NewMultiaddr(cfg.Addresses.Gateway)
|
// ignore error for gateway address
|
||||||
if gatewayMaddr == nil {
|
// if there is an error (invalid address), then don't run the gateway
|
||||||
fmt.Println("Invalid gateway address, not running gateway")
|
gatewayMaddr, _ = ma.NewMultiaddr(cfg.Addresses.Gateway)
|
||||||
|
if gatewayMaddr == nil {
|
||||||
|
log.Errorf("Invalid gateway address: %s", cfg.Addresses.Gateway)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// mount if the user provided the --mount flag
|
// mount if the user provided the --mount flag
|
||||||
|
Reference in New Issue
Block a user