mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 01:52:26 +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
|
||||
}
|
||||
|
||||
// ignore error for gateway address
|
||||
// if there is an error (invalid address), then don't run the gateway
|
||||
gatewayMaddr, _ := ma.NewMultiaddr(cfg.Addresses.Gateway)
|
||||
if gatewayMaddr == nil {
|
||||
fmt.Println("Invalid gateway address, not running gateway")
|
||||
var gatewayMaddr ma.Multiaddr
|
||||
if len(cfg.Addresses.Gateway) > 0 {
|
||||
// ignore error for gateway address
|
||||
// if there is an error (invalid address), then don't run the 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
|
||||
|
Reference in New Issue
Block a user