Skip to content

Commit 0afab87

Browse files
appleboylunny
authored andcommitted
refactor: remove redundant slash. (#1109)
1 parent c1d5983 commit 0afab87

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

modules/setting/setting.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,9 +583,7 @@ please consider changing to GITEA_CUSTOM`)
583583
sec := Cfg.Section("server")
584584
AppName = Cfg.Section("").Key("APP_NAME").MustString("Gitea: Git with a cup of tea")
585585
AppURL = sec.Key("ROOT_URL").MustString("http://localhost:3000/")
586-
if AppURL[len(AppURL)-1] != '/' {
587-
AppURL += "/"
588-
}
586+
AppURL = strings.TrimRight(AppURL, "/") + "/"
589587

590588
// Check if has app suburl.
591589
url, err := url.Parse(AppURL)

0 commit comments

Comments
 (0)