diff options
author | Bo-Yi Wu <appleboy.tw@gmail.com> | 2017-03-03 20:47:24 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-03-03 20:47:24 +0800 |
commit | 0afab876311a35c56a23b1f7903f9247d5673c8a (patch) | |
tree | eb595b747cb829b525a229bd366b2eca5264918c /modules | |
parent | c1d5983d3ea74dbee55e14bfb0b2d91d9cf702e7 (diff) | |
download | gitea-0afab876311a35c56a23b1f7903f9247d5673c8a.tar.gz gitea-0afab876311a35c56a23b1f7903f9247d5673c8a.zip |
refactor: remove redundant slash. (#1109)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/setting/setting.go | 4 |
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) |