summaryrefslogtreecommitdiffstats
path: root/modules/setting
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-08-07 10:13:05 -0700
committerUnknwon <u@gogs.io>2016-08-07 10:13:05 -0700
commitec92565f234deb75ea8df0c30a8772c4cd72bc2d (patch)
tree3b0f4885e1d9ab1afa1352a98f36f1ae702166c7 /modules/setting
parent2772791fdad8f0ec4ae49aad020f8afdff2f9c46 (diff)
downloadgitea-ec92565f234deb75ea8df0c30a8772c4cd72bc2d.tar.gz
gitea-ec92565f234deb75ea8df0c30a8772c4cd72bc2d.zip
#3393 fix missing sub-url prefix in relative avatar link
Diffstat (limited to 'modules/setting')
-rw-r--r--modules/setting/setting.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index 6581efe4f0..f59aa0884d 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -334,6 +334,7 @@ func NewContext() {
log.Fatal(4, "Invalid ROOT_URL '%s': %s", AppUrl, err)
}
// Suburl should start with '/' and end without '/', such as '/{subpath}'.
+ // This value is empty if site does not have sub-url.
AppSubUrl = strings.TrimSuffix(url.Path, "/")
AppSubUrlDepth = strings.Count(AppSubUrl, "/")