diff --git a/modules/setting/setting.go b/modules/setting/setting.go index f69dd11cebcf3..c727e962caef2 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -104,6 +104,7 @@ var ( GracefulHammerTime time.Duration StartupTimeout time.Duration StaticURLPrefix string + StaticURLPrefixManifest string AbsoluteAssetURL string SSH = struct { @@ -606,6 +607,11 @@ func NewContext() { // Suburl should start with '/' and end without '/', such as '/{subpath}'. // This value is empty if site does not have sub-url. AppSubURL = strings.TrimSuffix(appURL.Path, "/") + // FIXME: Why does the content of 'StaticURLPrefixManifest' depend on the ordering of + // the next two lines? + // Manifest on top: "" + // Manifest below: "/gitea" + StaticURLPrefixManifest = strings.TrimSuffix(sec.Key("STATIC_URL_PREFIX").MustString(""), "/") StaticURLPrefix = strings.TrimSuffix(sec.Key("STATIC_URL_PREFIX").MustString(AppSubURL), "/") AppSubURLDepth = strings.Count(AppSubURL, "/") // Check if Domain differs from AppURL domain than update it to AppURL's domain @@ -614,7 +620,7 @@ func NewContext() { Domain = urlHostname } - AbsoluteAssetURL = MakeAbsoluteAssetURL(AppURL, StaticURLPrefix) + AbsoluteAssetURL = MakeAbsoluteAssetURL(AppURL, StaticURLPrefixManifest) manifestBytes := MakeManifestData(AppName, AppURL, AbsoluteAssetURL) ManifestData = `application/json;base64,` + base64.StdEncoding.EncodeToString(manifestBytes)