]> source.dussan.org Git - gitea.git/commitdiff
refactor: remove redundant slash. (#1109)
authorBo-Yi Wu <appleboy.tw@gmail.com>
Fri, 3 Mar 2017 12:47:24 +0000 (20:47 +0800)
committerLunny Xiao <xiaolunwen@gmail.com>
Fri, 3 Mar 2017 12:47:24 +0000 (20:47 +0800)
modules/setting/setting.go

index c0756e30e9119173bd6adbc8eb4687595fc6f070..c490fb1d4202e28bdffca218dbe02eed077718e7 100644 (file)
@@ -583,9 +583,7 @@ please consider changing to GITEA_CUSTOM`)
        sec := Cfg.Section("server")
        AppName = Cfg.Section("").Key("APP_NAME").MustString("Gitea: Git with a cup of tea")
        AppURL = sec.Key("ROOT_URL").MustString("http://localhost:3000/")
-       if AppURL[len(AppURL)-1] != '/' {
-               AppURL += "/"
-       }
+       AppURL = strings.TrimRight(AppURL, "/") + "/"
 
        // Check if has app suburl.
        url, err := url.Parse(AppURL)