Skip to content

Commit

Permalink
parse SECURE=FAlsE as false bool
Browse files Browse the repository at this point in the history
  • Loading branch information
odrling committed Jul 17, 2024
1 parent 2840e10 commit f8ba4ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os"
"reflect"
"strconv"
"strings"
)

type ProducerListenConfig struct {
Expand Down Expand Up @@ -77,7 +78,7 @@ func setConfigValue(config_value reflect.Value, config_type reflect.Type, prefix
field.SetInt(int64(int_value))
case reflect.Bool:
value := getFieldValue(field_type, prefix)
field.SetBool(value != "" && value != "false" && value != "0")
field.SetBool(value != "" && strings.ToLower(value) != "false" && value != "0")
case reflect.Struct:
field_prefix := prefix + field_type.Tag.Get("env_prefix") + "_"
setConfigValue(field, field_type.Type, field_prefix)
Expand Down

0 comments on commit f8ba4ea

Please sign in to comment.