Browse Source

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.
pull/5181/head
jerebear12 1 year ago
committed by GitHub
parent
commit
8c966ac23b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      weed/server/filer_server.go

2
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
}
fs = &FilerServer{
option: option,

Loading…
Cancel
Save