summaryrefslogtreecommitdiffstats
path: root/modules/setting
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-04-10 13:57:36 +0200
committerGitHub <noreply@github.com>2022-04-10 19:57:36 +0800
commit6d51b9f615973da9542d7fe841134acee64b6cdf (patch)
treedda59f691aba9deaf8a28f8a693d13ac2df2e039 /modules/setting
parent72479bff89679136d75638384a77f42a477040c5 (diff)
downloadgitea-6d51b9f615973da9542d7fe841134acee64b6cdf.tar.gz
gitea-6d51b9f615973da9542d7fe841134acee64b6cdf.zip
Fixed registry host value. (#19363)
Diffstat (limited to 'modules/setting')
-rw-r--r--modules/setting/packages.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/setting/packages.go b/modules/setting/packages.go
index 65653b990e..5e0f2a3b03 100644
--- a/modules/setting/packages.go
+++ b/modules/setting/packages.go
@@ -5,6 +5,7 @@
package setting
import (
+ "net/url"
"os"
"path/filepath"
@@ -31,10 +32,8 @@ func newPackages() {
Packages.Storage = getStorage("packages", "", nil)
- Packages.RegistryHost = Domain
- if (Protocol == HTTP && HTTPPort != "80") || (Protocol == HTTPS && HTTPPort != "443") {
- Packages.RegistryHost += ":" + HTTPPort
- }
+ appURL, _ := url.Parse(AppURL)
+ Packages.RegistryHost = appURL.Host
Packages.ChunkedUploadPath = filepath.ToSlash(sec.Key("CHUNKED_UPLOAD_PATH").MustString("tmp/package-upload"))
if !filepath.IsAbs(Packages.ChunkedUploadPath) {