MM-11160 Adding proper CORS support. (#9152)

* Adding proper CORS support.

* Better CORS tests.
Этот коммит содержится в:
Christopher Speller
2018-07-26 08:31:22 -07:00
коммит произвёл GitHub
родитель 185ed89978
Коммит bae26ec268
12 изменённых файлов: 819 добавлений и 35 удалений

Просмотреть файл

@@ -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)
}