diff options
| author | jerebear12 <72420925+jerebear12@users.noreply.github.com> | 2024-01-08 13:35:20 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-08 11:35:20 -0800 |
| commit | 8c966ac23bf077806c1f9185e4822c1385bb8123 (patch) | |
| tree | e528cc46feceecfeb3e9d1412deba1018c516df2 | |
| parent | 121c59e2b7f60c50986a4d2c3663a99b96d625a6 (diff) | |
| download | seaweedfs-8c966ac23bf077806c1f9185e4822c1385bb8123.tar.xz seaweedfs-8c966ac23bf077806c1f9185e4822c1385bb8123.zip | |
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.
| -rw-r--r-- | weed/server/filer_server.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/weed/server/filer_server.go b/weed/server/filer_server.go index 20b5151cd..d8b2ad8dc 100644 --- a/weed/server/filer_server.go +++ b/weed/server/filer_server.go @@ -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, |
