Skip to content

Commit 9c439a7

Browse files
authored
Support slashes in release tags (#12864)
Fix #12861 Signed-off-by: Andrew Thornton <[email protected]>
1 parent a9decf0 commit 9c439a7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

routers/repo/release.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func SingleRelease(ctx *context.Context) {
132132
writeAccess := ctx.Repo.CanWrite(models.UnitTypeReleases)
133133
ctx.Data["CanCreateRelease"] = writeAccess && !ctx.Repo.Repository.IsArchived
134134

135-
release, err := models.GetRelease(ctx.Repo.Repository.ID, ctx.Params("tag"))
135+
release, err := models.GetRelease(ctx.Repo.Repository.ID, ctx.Params("*"))
136136
if err != nil {
137137
if models.IsErrReleaseNotExist(err) {
138138
ctx.NotFound("GetRelease", err)

routers/routes/routes.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,9 +822,9 @@ func RegisterRoutes(m *macaron.Macaron) {
822822
m.Group("/:username/:reponame", func() {
823823
m.Group("/releases", func() {
824824
m.Get("/", repo.Releases)
825-
m.Get("/tag/:tag", repo.SingleRelease)
825+
m.Get("/tag/*", repo.SingleRelease)
826826
m.Get("/latest", repo.LatestRelease)
827-
}, repo.MustBeNotEmpty, context.RepoRef())
827+
}, repo.MustBeNotEmpty, context.RepoRefByType(context.RepoRefTag))
828828
m.Group("/releases", func() {
829829
m.Get("/new", repo.NewRelease)
830830
m.Post("/new", bindIgnErr(auth.NewReleaseForm{}), repo.NewReleasePost)

0 commit comments

Comments
 (0)