summaryrefslogtreecommitdiff
path: root/service/http/config.go
diff options
context:
space:
mode:
authorDmitry Patsura <[email protected]>2019-06-13 21:03:15 +0300
committerDmitry Patsura <[email protected]>2019-06-13 21:03:15 +0300
commita612f9d4ac8d2f5659a2e984067baf5a11fd6c2a (patch)
treec788a86b155b9f99c2a5d388e62fb89a99da58f6 /service/http/config.go
parent4d3b5a3fdd7750e7b6389fc7b4c92d56226e941e (diff)
Feature: Allow to disable http, and use only FastCGI
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")
}