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 e98b67c commit 2840e10
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 @@ -76,7 +76,8 @@ func setConfigValue(config_value reflect.Value, config_type reflect.Type, prefix
}
field.SetInt(int64(int_value))
case reflect.Bool:
field.SetBool(getFieldValue(field_type, prefix) != "")
value := getFieldValue(field_type, prefix)
field.SetBool(value != "" && 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 2840e10

Please sign in to comment.