aboutsummaryrefslogtreecommitdiff
path: root/mediaapi
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-07-08 16:39:50 +0100
committerGitHub <noreply@github.com>2020-07-08 16:39:50 +0100
commit6bee6e77d97ff1413bccc759385a68a90421ac8c (patch)
tree678e7481dc7e0eff887bbefe2dfb43556a0c2dce /mediaapi
parent4370a808e394e23f36dfd61fd82bba95720ae075 (diff)
Yet another v1 vs r0 media endpoint (#1190)
Diffstat (limited to 'mediaapi')
-rw-r--r--mediaapi/routing/routing.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/mediaapi/routing/routing.go b/mediaapi/routing/routing.go
index bc0de0f4..f4a8b157 100644
--- a/mediaapi/routing/routing.go
+++ b/mediaapi/routing/routing.go
@@ -53,12 +53,16 @@ func Setup(
activeThumbnailGeneration := &types.ActiveThumbnailGeneration{
PathToResult: map[string]*types.ThumbnailGenerationResult{},
}
- r0mux.Handle("/upload", httputil.MakeAuthAPI(
+
+ uploadHandler := httputil.MakeAuthAPI(
"upload", userAPI,
func(req *http.Request, _ *userapi.Device) util.JSONResponse {
return Upload(req, cfg, db, activeThumbnailGeneration)
},
- )).Methods(http.MethodPost, http.MethodOptions)
+ )
+
+ r0mux.Handle("/upload", uploadHandler).Methods(http.MethodPost, http.MethodOptions)
+ v1mux.Handle("/upload", uploadHandler).Methods(http.MethodPost, http.MethodOptions)
activeRemoteRequests := &types.ActiveRemoteRequests{
MXCToResult: map[string]*types.RemoteRequestResult{},