aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-07-24 02:08:04 +0800
committerGitHub <noreply@github.com>2021-07-23 14:08:04 -0400
commit9421bfedb35cfaa26cd1cd6e996e69a89fb8a87b (patch)
treecabaaac5a198fcc03d35bcb65d4ea8f82c29b28f
parentab77768fce174180200f3890ef49b725b8ffdbf1 (diff)
downloadgitea-9421bfedb35cfaa26cd1cd6e996e69a89fb8a87b.tar.gz
gitea-9421bfedb35cfaa26cd1cd6e996e69a89fb8a87b.zip
Fix issue pasted image missing if no release permission (#16520)
* Fix issue pasted image missing if no release permission * Update routers/web/web.go Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
-rw-r--r--routers/web/web.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/routers/web/web.go b/routers/web/web.go
index d06a7fc88e..26e6c31a47 100644
--- a/routers/web/web.go
+++ b/routers/web/web.go
@@ -827,9 +827,14 @@ func RegisterRoutes(m *web.Route) {
}
ctx.Data["CommitsCount"] = ctx.Repo.CommitsCount
})
- m.Get("/attachments/{uuid}", repo.GetAttachment)
+
}, ignSignIn, context.RepoAssignment, context.UnitTypes(), reqRepoReleaseReader)
+ // to maintain compatibility with old attachments
+ m.Group("/{username}/{reponame}", func() {
+ m.Get("/attachments/{uuid}", repo.GetAttachment)
+ }, ignSignIn, context.RepoAssignment, context.UnitTypes())
+
m.Group("/{username}/{reponame}", func() {
m.Post("/topics", repo.TopicsPost)
}, context.RepoAssignment, context.RepoMustNotBeArchived(), reqRepoAdmin)