MM-11160 Adding proper CORS support. (#9152)
* Adding proper CORS support. * Better CORS tests.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
185ed89978
Коммит
bae26ec268
@@ -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)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user