mirror of
https://gitlab.com/commento/commento.git
synced 2025-06-29 22:56:37 -04:00
config.go: trim trailing slash in ORIGIN and CDN_PREFIX
Fixes https://gitlab.com/commento/commento-ce/issues/59
This commit is contained in:
@ -62,10 +62,14 @@ func configParse() error {
|
||||
}
|
||||
}
|
||||
|
||||
os.Setenv("ORIGIN", strings.TrimSuffix(os.Getenv("ORIGIN"), "/"))
|
||||
|
||||
if os.Getenv("CDN_PREFIX") == "" {
|
||||
os.Setenv("CDN_PREFIX", os.Getenv("ORIGIN"))
|
||||
}
|
||||
|
||||
os.Setenv("CDN_PREFIX", strings.TrimSuffix(os.Getenv("ORIGIN"), "/"))
|
||||
|
||||
if os.Getenv("FORBID_NEW_OWNERS") != "true" && os.Getenv("FORBID_NEW_OWNERS") != "false" {
|
||||
logger.Errorf("COMMENTO_FORBID_NEW_OWNERS neither 'true' nor 'false'")
|
||||
return errorInvalidConfigValue
|
||||
|
Reference in New Issue
Block a user