Skip to content

Commit

Permalink
Only split when required
Browse files Browse the repository at this point in the history
  • Loading branch information
bolkedebruin committed Mar 19, 2024
1 parent 7bf2a59 commit a7ea312
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cmd/rdpgw/config/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,14 @@ func Load(configFile string) Configuration {
key := strings.Replace(strings.ToLower(strings.TrimPrefix(s, "RDPGW_")), "__", ".", -1)
key = ToCamel(key)

newVal := strings.Split(strings.Trim(v, " "), " ")
log.Printf("Setting %s to %v", key, newVal)
// handle the case where the value is a list
return key, newVal
v = strings.Trim(v, " ")

// handle lists
if strings.Contains(v, " ") {
return key, strings.Split(v, " ")
}
return key, v

}), nil); err != nil {
log.Fatalf("Error loading config from environment: %v", err)
}
Expand Down

0 comments on commit a7ea312

Please sign in to comment.