aboutsummaryrefslogtreecommitdiff
path: root/internal/route/api/v1/api.go
diff options
context:
space:
mode:
authorMateusz Reszka <mateusz.reszka@outlook.com>2022-10-22 17:52:48 +0200
committerGitHub <noreply@github.com>2022-10-22 23:52:48 +0800
commit742bc36edd92229cf78608af7f950e65f71a0a01 (patch)
tree56235af3f9492d4f33b8fa79fbd51da96fde7257 /internal/route/api/v1/api.go
parenta7299bbb8d8b363f3d828e04e060921aa0c31d93 (diff)
api: support put content (#7114)
Co-authored-by: Joe Chen <jc@unknwon.io>
Diffstat (limited to 'internal/route/api/v1/api.go')
-rw-r--r--internal/route/api/v1/api.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/route/api/v1/api.go b/internal/route/api/v1/api.go
index f1684691..0a17e657 100644
--- a/internal/route/api/v1/api.go
+++ b/internal/route/api/v1/api.go
@@ -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() {