diff --git a/controllers/admin/config.go b/controllers/admin/config.go index 529ace488..ed56ac05f 100644 --- a/controllers/admin/config.go +++ b/controllers/admin/config.go @@ -391,7 +391,16 @@ func SetServerURL(w http.ResponseWriter, r *http.Request) { return } - if err := data.SetServerURL(configValue.Value.(string)); err != nil { + rawValue, ok := configValue.Value.(string) + if !ok { + controllers.WriteSimpleResponse(w, false, "server url value invalid") + return + } + + // Trim any trailing slash + serverURL := strings.TrimRight(rawValue, "/") + + if err := data.SetServerURL(serverURL); err != nil { controllers.WriteSimpleResponse(w, false, err.Error()) return }