mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-04 13:50:39 +00:00
parent
15f6ec9632
commit
35c3510335
2 changed files with 8 additions and 2 deletions
|
@ -72,8 +72,8 @@ func URLJoin(base string, elems ...string) string {
|
|||
return ""
|
||||
}
|
||||
joinedURL := baseURL.ResolveReference(argURL).String()
|
||||
if !baseURL.IsAbs() {
|
||||
return joinedURL[1:] // Removing leading '/'
|
||||
if !baseURL.IsAbs() && !strings.HasPrefix(base, "/") {
|
||||
return joinedURL[1:] // Removing leading '/' if needed
|
||||
}
|
||||
return joinedURL
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue