From 53c573ed02bb2541a9af5bdd603f45e2db6d6ae4 Mon Sep 17 00:00:00 2001 From: Thibault Meyer <0xbaadf00d@users.noreply.github.com> Date: Thu, 11 Aug 2016 22:45:42 +0200 Subject: [PATCH] Fix #3314: Cannot edit release with tag name contains slash (#3434) --- cmd/web.go | 4 ++-- routers/repo/release.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/web.go b/cmd/web.go index a0b53981cf..f7ab661d41 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -488,8 +488,8 @@ func runWeb(ctx *cli.Context) error { m.Group("/releases", func() { m.Get("/new", repo.NewRelease) m.Post("/new", bindIgnErr(auth.NewReleaseForm{}), repo.NewReleasePost) - m.Get("/edit/:tagname", repo.EditRelease) - m.Post("/edit/:tagname", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost) + m.Get("/edit/*", repo.EditRelease) + m.Post("/edit/*", bindIgnErr(auth.EditReleaseForm{}), repo.EditReleasePost) m.Post("/delete", repo.DeleteRelease) }, reqRepoWriter, context.RepoRef()) diff --git a/routers/repo/release.go b/routers/repo/release.go index efbe6c982f..a00bd944cb 100644 --- a/routers/repo/release.go +++ b/routers/repo/release.go @@ -224,7 +224,7 @@ func EditRelease(ctx *context.Context) { ctx.Data["PageIsReleaseList"] = true ctx.Data["PageIsEditRelease"] = true - tagName := ctx.Params(":tagname") + tagName := ctx.Params("*") rel, err := models.GetRelease(ctx.Repo.Repository.ID, tagName) if err != nil { if models.IsErrReleaseNotExist(err) { @@ -249,7 +249,7 @@ func EditReleasePost(ctx *context.Context, form auth.EditReleaseForm) { ctx.Data["PageIsReleaseList"] = true ctx.Data["PageIsEditRelease"] = true - tagName := ctx.Params(":tagname") + tagName := ctx.Params("*") rel, err := models.GetRelease(ctx.Repo.Repository.ID, tagName) if err != nil { if models.IsErrReleaseNotExist(err) {