aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeripath2020-09-17 21:33:48 +0100
committerGitHub2020-09-17 15:33:48 -0500
commitd624e91c0c7b0997fa4aa497d46650b7ba3cc1d6 (patch)
treedf67d408822be376c239450abcf062b66c91e68b
parent62a3c847cdc47bf90875882da7ec23bbe16f0326 (diff)
Support slashes in release tags (#12864) (#12882)
Backport #12864 Fix #12861 Signed-off-by: Andrew Thornton <art27@cantab.net>
-rw-r--r--routers/repo/release.go2
-rw-r--r--routers/routes/routes.go4
2 files changed, 3 insertions, 3 deletions
diff --git a/routers/repo/release.go b/routers/repo/release.go
index 3b8e55f00..bb755dd8e 100644
--- a/routers/repo/release.go
+++ b/routers/repo/release.go
@@ -132,7 +132,7 @@ func SingleRelease(ctx *context.Context) {
writeAccess := ctx.Repo.CanWrite(models.UnitTypeReleases)
ctx.Data["CanCreateRelease"] = writeAccess && !ctx.Repo.Repository.IsArchived
- release, err := models.GetRelease(ctx.Repo.Repository.ID, ctx.Params("tag"))
+ release, err := models.GetRelease(ctx.Repo.Repository.ID, ctx.Params("*"))
if err != nil {
if models.IsErrReleaseNotExist(err) {
ctx.NotFound("GetRelease", err)
diff --git a/routers/routes/routes.go b/routers/routes/routes.go
index 34157ea5b..19352d96a 100644
--- a/routers/routes/routes.go
+++ b/routers/routes/routes.go
@@ -814,9 +814,9 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Group("/:username/:reponame", func() {
m.Group("/releases", func() {
m.Get("/", repo.Releases)
- m.Get("/tag/:tag", repo.SingleRelease)
+ m.Get("/tag/*", repo.SingleRelease)
m.Get("/latest", repo.LatestRelease)
- }, repo.MustBeNotEmpty, context.RepoRef())
+ }, repo.MustBeNotEmpty, context.RepoRefByType(context.RepoRefTag))
m.Group("/releases", func() {
m.Get("/new", repo.NewRelease)
m.Post("/new", bindIgnErr(auth.NewReleaseForm{}), repo.NewReleasePost)