api: support put content (#7114)

Co-authored-by: Joe Chen <jc@unknwon.io>
This commit is contained in:
Mateusz Reszka
2022-10-22 17:52:48 +02:00
committed by GitHub
parent a7299bbb8d
commit 742bc36edd
4 changed files with 174 additions and 88 deletions

View File

@@ -273,7 +273,9 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Get("/raw/*", context.RepoRef(), repo.GetRawFile)
m.Group("/contents", func() {
m.Get("", repo.GetContents)
m.Get("/*", repo.GetContents)
m.Combo("/*").
Get(repo.GetContents).
Put(bind(repo.PutContentsRequest{}), repo.PutContents)
})
m.Get("/archive/*", repo.GetArchive)
m.Group("/git", func() {