diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-07-26 08:31:22 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-26 08:31:22 -0700 |
commit | bae26ec268aef4e85d5055f1b83c6b3992bf178f (patch) | |
tree | 74ab5e508661068b30516c704ffc0a9b02efa8d5 /model | |
parent | 185ed89978e0d88d75b5c606104e78058753bd4d (diff) | |
download | chat-bae26ec268aef4e85d5055f1b83c6b3992bf178f.tar.gz chat-bae26ec268aef4e85d5055f1b83c6b3992bf178f.tar.bz2 chat-bae26ec268aef4e85d5055f1b83c6b3992bf178f.zip |
MM-11160 Adding proper CORS support. (#9152)
* Adding proper CORS support.
* Better CORS tests.
Diffstat (limited to 'model')
-rw-r--r-- | model/config.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/model/config.go b/model/config.go index f36b321ec..1d0f40901 100644 --- a/model/config.go +++ b/model/config.go @@ -203,6 +203,9 @@ type ServiceSettings struct { EnforceMultifactorAuthentication *bool EnableUserAccessTokens *bool AllowCorsFrom *string + CorsExposedHeaders *string + CorsAllowCredentials *bool + CorsDebug *bool AllowCookiesForSubdomains *bool SessionLengthWebInDays *int SessionLengthMobileInDays *int @@ -413,6 +416,18 @@ func (s *ServiceSettings) SetDefaults() { s.AllowCorsFrom = NewString(SERVICE_SETTINGS_DEFAULT_ALLOW_CORS_FROM) } + if s.CorsExposedHeaders == nil { + s.CorsExposedHeaders = NewString("") + } + + if s.CorsAllowCredentials == nil { + s.CorsAllowCredentials = NewBool(false) + } + + if s.CorsDebug == nil { + s.CorsDebug = NewBool(false) + } + if s.AllowCookiesForSubdomains == nil { s.AllowCookiesForSubdomains = NewBool(false) } |