File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -471,6 +471,7 @@ func HandleKeyRequests() func(*Server) {
471471func HandleMediaRequests (mediaIds map [string ]func (w http.ResponseWriter )) func (* Server ) {
472472 return func (srv * Server ) {
473473 mediamux := srv .mux .PathPrefix ("/_matrix/media" ).Subrouter ()
474+ mediamuxAuthenticated := srv .mux .PathPrefix ("/_matrix/federation/v1/media" ).Subrouter ()
474475
475476 downloadFn := http .HandlerFunc (func (w http.ResponseWriter , req * http.Request ) {
476477 vars := mux .Vars (req )
@@ -497,6 +498,9 @@ func HandleMediaRequests(mediaIds map[string]func(w http.ResponseWriter)) func(*
497498 mediamux .Handle ("/r0/download/{origin}/{mediaId}" , downloadFn ).Methods ("GET" )
498499 mediamux .Handle ("/v1/download/{origin}/{mediaId}" , downloadFn ).Methods ("GET" )
499500 mediamux .Handle ("/v3/download/{origin}/{mediaId}" , downloadFn ).Methods ("GET" )
501+
502+ // Also handle authenticated media requests
503+ mediamuxAuthenticated .Handle ("/download/{mediaId}" , downloadFn ).Methods ("GET" )
500504 }
501505}
502506
You can’t perform that action at this time.
0 commit comments