Skip to content
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions proposals/3860-media-download-redirect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# MSC3860: Media Download Redirects

Currently the media download endpoints must return either a 200 with content or error responses. This
means the media server instance must stream the data from wherever it is stored, which is likely not
local to itself. Allowing redirects on these endpoints would make it possible for the media repo to
tell clients/servers to pull data direct from the source, eg. a CDN.

## Proposal

This MSC simply proposes that a 307 redirect code is allowed and followed according to the `Location`
header. It is possible some clients would already follow these which needs to be confirmed. Specifc
endpoints in question:

+ `/_matrix/media/v3/download/{serverName}/{mediaId}`
+ `/_matrix/media/v3/download/{serverName}/{mediaId}/{fileName}`
+ `/_matrix/media/v3/thumbnail/{serverName}/{mediaId}`

The media repo already conforms to standard HTTP practices so this may already work as expected. The
MSC is proposing to add redirects to the list of possible HTTP responses for the above endpoints in
the Matrix Specifiction. Implementation would be confirming that this works in all the major clients.