Skip to content

Commit e823e33

Browse files
committed
Fix MakeAbsoluteAssetURL.
1 parent e87576b commit e823e33

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

modules/setting/server.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515

1616
"code.gitea.io/gitea/modules/json"
1717
"code.gitea.io/gitea/modules/log"
18-
"code.gitea.io/gitea/modules/util"
1918
)
2019

2120
// Scheme describes protocol types
@@ -160,7 +159,11 @@ func MakeAbsoluteAssetURL(appURL, staticURLPrefix string) string {
160159
}
161160

162161
// StaticURLPrefix is just a path
163-
return util.URLJoin(appURL, strings.TrimSuffix(staticURLPrefix, "/"))
162+
base, err := url.Parse(appURL)
163+
if err != nil {
164+
log.Fatal("Unable to parse url: %v", err)
165+
}
166+
return base.ResolveReference(parsedPrefix).String()
164167
}
165168

166169
return strings.TrimSuffix(staticURLPrefix, "/")

0 commit comments

Comments
 (0)