mirror of
https://github.com/gogs/gogs.git
synced 2025-12-23 12:14:07 +01:00
pkg/context: expose port in import path for 'go-get=1' (#5305)
This commit is contained in:
2
gogs.go
2
gogs.go
@@ -16,7 +16,7 @@ import (
|
|||||||
"github.com/gogs/gogs/pkg/setting"
|
"github.com/gogs/gogs/pkg/setting"
|
||||||
)
|
)
|
||||||
|
|
||||||
const APP_VER = "0.11.74.1202"
|
const APP_VER = "0.11.75.1203"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
setting.AppVer = APP_VER
|
setting.AppVer = APP_VER
|
||||||
|
|||||||
@@ -263,6 +263,12 @@ func Contexter() macaron.Handler {
|
|||||||
branchName = repo.DefaultBranch
|
branchName = repo.DefaultBranch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Non-80 port needs to match port number in import path as well
|
||||||
|
host := setting.Domain
|
||||||
|
if setting.HTTPPort != "80" {
|
||||||
|
host += ":" + setting.HTTPPort
|
||||||
|
}
|
||||||
|
|
||||||
prefix := setting.AppURL + path.Join(ownerName, repoName, "src", branchName)
|
prefix := setting.AppURL + path.Join(ownerName, repoName, "src", branchName)
|
||||||
c.PlainText(http.StatusOK, []byte(com.Expand(`<!doctype html>
|
c.PlainText(http.StatusOK, []byte(com.Expand(`<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
@@ -275,7 +281,7 @@ func Contexter() macaron.Handler {
|
|||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
`, map[string]string{
|
`, map[string]string{
|
||||||
"GoGetImport": path.Join(setting.Domain, setting.AppSubURL, repo.FullName()),
|
"GoGetImport": path.Join(host, setting.AppSubURL, repo.FullName()),
|
||||||
"CloneLink": models.ComposeHTTPSCloneURL(ownerName, repoName),
|
"CloneLink": models.ComposeHTTPSCloneURL(ownerName, repoName),
|
||||||
"GoDocDirectory": prefix + "{/dir}",
|
"GoDocDirectory": prefix + "{/dir}",
|
||||||
"GoDocFile": prefix + "{/dir}/{file}#L{line}",
|
"GoDocFile": prefix + "{/dir}/{file}#L{line}",
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
0.11.74.1202
|
0.11.75.1203
|
||||||
|
|||||||
Reference in New Issue
Block a user