Skip to content

Commit 9421bfe

Browse files
lunnyzeripath6543
authored
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 <[email protected]> Co-authored-by: zeripath <[email protected]> Co-authored-by: 6543 <[email protected]>
1 parent ab77768 commit 9421bfe

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

routers/web/web.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,9 +827,14 @@ func RegisterRoutes(m *web.Route) {
827827
}
828828
ctx.Data["CommitsCount"] = ctx.Repo.CommitsCount
829829
})
830-
m.Get("/attachments/{uuid}", repo.GetAttachment)
830+
831831
}, ignSignIn, context.RepoAssignment, context.UnitTypes(), reqRepoReleaseReader)
832832

833+
// to maintain compatibility with old attachments
834+
m.Group("/{username}/{reponame}", func() {
835+
m.Get("/attachments/{uuid}", repo.GetAttachment)
836+
}, ignSignIn, context.RepoAssignment, context.UnitTypes())
837+
833838
m.Group("/{username}/{reponame}", func() {
834839
m.Post("/topics", repo.TopicsPost)
835840
}, context.RepoAssignment, context.RepoMustNotBeArchived(), reqRepoAdmin)

0 commit comments

Comments
 (0)