mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-22 22:43:33 +08:00
Removed problematic if statement (#5180)
This if statement was causing the value of option.AllowedOrigins to be always equal to "*". Now the values in the config file will be used when present. This allows for people who don't need this feature to not update their security.toml files.
This commit is contained in:
@@ -111,11 +111,9 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption)
|
||||
|
||||
v.SetDefault("cors.allowed_origins.values", "*")
|
||||
|
||||
if (option.AllowedOrigins == nil) || (len(option.AllowedOrigins) == 0) {
|
||||
allowedOrigins := v.GetString("cors.allowed_origins.values")
|
||||
domains := strings.Split(allowedOrigins, ",")
|
||||
option.AllowedOrigins = domains
|
||||
}
|
||||
allowedOrigins := v.GetString("cors.allowed_origins.values")
|
||||
domains := strings.Split(allowedOrigins, ",")
|
||||
option.AllowedOrigins = domains
|
||||
|
||||
fs = &FilerServer{
|
||||
option: option,
|
||||
|
Reference in New Issue
Block a user