summaryrefslogtreecommitdiff
path: root/service/http/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'service/http/config.go')
-rw-r--r--service/http/config.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/service/http/config.go b/service/http/config.go
index 585216d5..4b5950b3 100644
--- a/service/http/config.go
+++ b/service/http/config.go
@@ -54,6 +54,10 @@ type SSLConfig struct {
Cert string
}
+func (c *Config) EnableHTTP() bool {
+ return c.Address != ""
+}
+
// EnableTLS returns true if rr must listen TLS connections.
func (c *Config) EnableTLS() bool {
return c.SSL.Key != "" || c.SSL.Cert != ""
@@ -157,7 +161,7 @@ func (c *Config) Valid() error {
return err
}
- if !strings.Contains(c.Address, ":") {
+ if c.Address != "" && !strings.Contains(c.Address, ":") {
return errors.New("mailformed http server address")
}