mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00: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:
parent
121c59e2b7
commit
8c966ac23b
|
@ -111,11 +111,9 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption)
|
||||||
|
|
||||||
v.SetDefault("cors.allowed_origins.values", "*")
|
v.SetDefault("cors.allowed_origins.values", "*")
|
||||||
|
|
||||||
if (option.AllowedOrigins == nil) || (len(option.AllowedOrigins) == 0) {
|
|
||||||
allowedOrigins := v.GetString("cors.allowed_origins.values")
|
allowedOrigins := v.GetString("cors.allowed_origins.values")
|
||||||
domains := strings.Split(allowedOrigins, ",")
|
domains := strings.Split(allowedOrigins, ",")
|
||||||
option.AllowedOrigins = domains
|
option.AllowedOrigins = domains
|
||||||
}
|
|
||||||
|
|
||||||
fs = &FilerServer{
|
fs = &FilerServer{
|
||||||
option: option,
|
option: option,
|
||||||
|
|
Loading…
Reference in a new issue