Skip to content

Commit 89f680a

Browse files
lunnyzeripath6543
authored
Fix issue pasted image missing if no release permission (#16520) (#16527)
* Fix issue pasted image missing if no release permission Co-authored-by: zeripath <[email protected]> Co-authored-by: 6543 <[email protected]>
1 parent 67942ac commit 89f680a

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
@@ -822,9 +822,14 @@ func RegisterRoutes(m *web.Route) {
822822
}
823823
ctx.Data["CommitsCount"] = ctx.Repo.CommitsCount
824824
})
825-
m.Get("/attachments/{uuid}", repo.GetAttachment)
825+
826826
}, ignSignIn, context.RepoAssignment, context.UnitTypes(), reqRepoReleaseReader)
827827

828+
// to maintain compatibility with old attachments
829+
m.Group("/{username}/{reponame}", func() {
830+
m.Get("/attachments/{uuid}", repo.GetAttachment)
831+
}, ignSignIn, context.RepoAssignment, context.UnitTypes())
832+
828833
m.Group("/{username}/{reponame}", func() {
829834
m.Post("/topics", repo.TopicsPost)
830835
}, context.RepoAssignment, context.RepoMustNotBeArchived(), reqRepoAdmin)

0 commit comments

Comments
 (0)