summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorBo-Yi Wu <appleboy.tw@gmail.com>2017-03-03 20:47:24 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2017-03-03 20:47:24 +0800
commit0afab876311a35c56a23b1f7903f9247d5673c8a (patch)
treeeb595b747cb829b525a229bd366b2eca5264918c /modules
parentc1d5983d3ea74dbee55e14bfb0b2d91d9cf702e7 (diff)
downloadgitea-0afab876311a35c56a23b1f7903f9247d5673c8a.tar.gz
gitea-0afab876311a35c56a23b1f7903f9247d5673c8a.zip
refactor: remove redundant slash. (#1109)
Diffstat (limited to 'modules')
-rw-r--r--modules/setting/setting.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index c0756e30e9..c490fb1d42 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -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)