Support access branch that contains slash character

Resolve #101
This commit is contained in:
Gary Wang 2022-07-06 11:25:46 +08:00
parent 48a49f69a7
commit e4db7e8510

View file

@ -89,6 +89,10 @@ func Handler(mainDomainSuffix, rawDomain []byte,
return false
}
// Replace "~" to "/" so we can access branch that contains slash character
// Branch name cannot contain "~" so doing this is okay
branch = strings.ReplaceAll(branch, "~", "/")
// Check if the branch exists, otherwise treat it as a file path
branchTimestampResult := upstream.GetBranchTimestamp(giteaClient, targetOwner, repo, branch, branchTimestampCache)
if branchTimestampResult == nil {