1
mirror of https://gitlab.com/commento/commento.git synced 2025-06-29 22:56:37 -04:00

config.go: add http prefix to ORIGIN and CDN_PREFIX

This commit is contained in:
Adhityaa Chandrasekar
2018-08-12 22:38:48 +05:30
parent 89a81ece19
commit 3205766248
2 changed files with 11 additions and 0 deletions

View File

@ -63,12 +63,14 @@ func configParse() error {
}
os.Setenv("ORIGIN", strings.TrimSuffix(os.Getenv("ORIGIN"), "/"))
os.Setenv("ORIGIN", addHttpIfAbsent(os.Getenv("ORIGIN")))
if os.Getenv("CDN_PREFIX") == "" {
os.Setenv("CDN_PREFIX", os.Getenv("ORIGIN"))
}
os.Setenv("CDN_PREFIX", strings.TrimSuffix(os.Getenv("ORIGIN"), "/"))
os.Setenv("CDN_PREFIX", addHttpIfAbsent(os.Getenv("CDN_PREFIX")))
if os.Getenv("FORBID_NEW_OWNERS") != "true" && os.Getenv("FORBID_NEW_OWNERS") != "false" {
logger.Errorf("COMMENTO_FORBID_NEW_OWNERS neither 'true' nor 'false'")