Use strconv.ParseBool

This commit is contained in:
Seth Vargo 2015-05-15 16:41:30 -04:00
parent 5c93047642
commit c47ecbc9d3

View file

@ -293,8 +293,15 @@ func (c *ServerCommand) detectAdvertise(detect physical.AdvertiseDetect,
}
// Check if TLS is disabled
if val, ok := list.Config["tls_disable"]; ok && val == "1" {
scheme = "http"
if val, ok := list.Config["tls_disable"]; ok {
disable, err := strconv.ParseBool(val)
if err != nil {
return "", fmt.Errorf("tls_disable: %s", err)
}
if disable {
scheme = "http"
}
}
// Check for address override