aboutsummaryrefslogtreecommitdiffstats
path: root/routers/routes/routes.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/routes/routes.go')
-rw-r--r--routers/routes/routes.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/routers/routes/routes.go b/routers/routes/routes.go
index 58274626c0..8ab7ff9bea 100644
--- a/routers/routes/routes.go
+++ b/routers/routes/routes.go
@@ -731,6 +731,15 @@ func RegisterRoutes(m *macaron.Macaron) {
})
}, repo.MustAllowPulls)
+ m.Group("/media", func() {
+ m.Get("/branch/*", context.RepoRefByType(context.RepoRefBranch), repo.SingleDownloadOrLFS)
+ m.Get("/tag/*", context.RepoRefByType(context.RepoRefTag), repo.SingleDownloadOrLFS)
+ m.Get("/commit/*", context.RepoRefByType(context.RepoRefCommit), repo.SingleDownloadOrLFS)
+ m.Get("/blob/:sha", context.RepoRefByType(context.RepoRefBlob), repo.DownloadByIDOrLFS)
+ // "/*" route is deprecated, and kept for backward compatibility
+ m.Get("/*", context.RepoRefByType(context.RepoRefLegacy), repo.SingleDownloadOrLFS)
+ }, repo.MustBeNotEmpty, reqRepoCodeReader)
+
m.Group("/raw", func() {
m.Get("/branch/*", context.RepoRefByType(context.RepoRefBranch), repo.SingleDownload)
m.Get("/tag/*", context.RepoRefByType(context.RepoRefTag), repo.SingleDownload)