From bae26ec268aef4e85d5055f1b83c6b3992bf178f Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Thu, 26 Jul 2018 08:31:22 -0700 Subject: MM-11160 Adding proper CORS support. (#9152) * Adding proper CORS support. * Better CORS tests. --- model/config.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'model/config.go') 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) } -- cgit v1.2.3-1-g7c22