Commit fa318049 authored by Sietse Ringers's avatar Sietse Ringers
Browse files

fix: irma server did not apply production mode defaults when using IRMASERVER_PRODUCTION env flag

Fixes #37
parent 9c1216a6
...@@ -288,9 +288,15 @@ func productionMode() bool { ...@@ -288,9 +288,15 @@ func productionMode() bool {
if len(os.Args) == i+1 || strings.HasPrefix(os.Args[i+1], "--") { if len(os.Args) == i+1 || strings.HasPrefix(os.Args[i+1], "--") {
return true return true
} }
val := strings.ToLower(os.Args[i+1]) if checkConfVal(os.Args[i+1]) {
return val == "1" || val == "true" || val == "yes" || val == "t" return true
}
} }
} }
return false
return checkConfVal(os.Getenv("IRMASERVER_PRODUCTION"))
}
func checkConfVal(val string) bool {
lc := strings.ToLower(val)
return lc == "1" || lc == "true" || lc == "yes" || lc == "t"
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment