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:
@ -110,3 +110,18 @@ func TestConfigParseStaticNotADirectory(t *testing.T) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfigOriginTrailingSlash(t *testing.T) {
|
||||
os.Setenv("COMMENTO_ORIGIN", "https://commento.io/")
|
||||
os.Setenv("COMMENTO_STATIC", "")
|
||||
|
||||
if err := configParse(); err != nil {
|
||||
t.Errorf("unexpected error when parsing config: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
if os.Getenv("ORIGIN") != "https://commento.io" {
|
||||
t.Errorf("expected ORIGIN=https://commento.io got ORIGIN=%s", os.Getenv("ORIGIN"))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user