diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-05-18 08:37:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-18 08:37:43 -0700 |
commit | 0432f995ec27de9ee6cc2f5847d4a17fcc095a26 (patch) | |
tree | cc87cb698389d6191f6fc9d34fcacddb44850bb6 /model/config.go | |
parent | d5e1f7e2982c2fcc888ccac550b34095efbee217 (diff) | |
download | chat-0432f995ec27de9ee6cc2f5847d4a17fcc095a26.tar.gz chat-0432f995ec27de9ee6cc2f5847d4a17fcc095a26.tar.bz2 chat-0432f995ec27de9ee6cc2f5847d4a17fcc095a26.zip |
MM-9983 Requiring SiteURL to be set. (#8769)
* Requiring SiteURL to be set.
* Modifying to make tests pass.
* Fixing test.
Diffstat (limited to 'model/config.go')
-rw-r--r-- | model/config.go | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/model/config.go b/model/config.go index a54d44110..4710658ec 100644 --- a/model/config.go +++ b/model/config.go @@ -1870,18 +1870,10 @@ func (o *Config) SetDefaults() { } func (o *Config) IsValid() *AppError { - if len(*o.ServiceSettings.SiteURL) == 0 && *o.EmailSettings.EnableEmailBatching { - return NewAppError("Config.IsValid", "model.config.is_valid.site_url_email_batching.app_error", nil, "", http.StatusBadRequest) - } - if *o.ClusterSettings.Enable && *o.EmailSettings.EnableEmailBatching { return NewAppError("Config.IsValid", "model.config.is_valid.cluster_email_batching.app_error", nil, "", http.StatusBadRequest) } - if len(*o.ServiceSettings.SiteURL) == 0 && *o.ServiceSettings.AllowCookiesForSubdomains { - return NewAppError("Config.IsValid", "Allowing cookies for subdomains requires SiteURL to be set.", nil, "", http.StatusBadRequest) - } - if err := o.TeamSettings.isValid(); err != nil { return err } @@ -2187,12 +2179,6 @@ func (ss *ServiceSettings) isValid() *AppError { return NewAppError("Config.IsValid", "model.config.is_valid.login_attempts.app_error", nil, "", http.StatusBadRequest) } - if len(*ss.SiteURL) != 0 { - if _, err := url.ParseRequestURI(*ss.SiteURL); err != nil { - return NewAppError("Config.IsValid", "model.config.is_valid.site_url.app_error", nil, "", http.StatusBadRequest) - } - } - if len(*ss.WebsocketURL) != 0 { if _, err := url.ParseRequestURI(*ss.WebsocketURL); err != nil { return NewAppError("Config.IsValid", "model.config.is_valid.websocket_url.app_error", nil, "", http.StatusBadRequest) |