| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* Add 'sandbox' to the CSP for media repo
* Changelog
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Synapse doesn’t allow for media resources to be played directly from
Chrome. It is a problem for users on other networks (e.g. IRC)
communicating with Matrix users through a gateway. The gateway sends
them the raw URL for the resource when a Matrix user uploads a video
and the video cannot be played directly in Chrome using that URL.
Chrome argues it is not authorized to play the video because of the
Content Security Policy. Chrome checks for the "media-src" policy which
is missing, and defauts to the "default-src" policy which is "none".
As Synapse already sends "object-src: 'self'" I thought it wouldn’t be
a problem to add "media-src: 'self'" to the CSP to fix this problem.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
(instead of everywhere that writes a response. Or rather, the subset of places
which write responses where we haven't forgotten it).
This also means that we don't have to have the mysterious version_string
attribute in anything with a request handler.
Unfortunately it does mean that we have to pass the version string wherever we
instantiate a SynapseSite, which has been c&ped 150 times, but that is code
that ought to be cleaned up anyway really.
|
|
|
|
|
|
| |
This is needless complexity; we might as well use the wrapper directly.
Also rename wrap_request_handler->wrap_json_request_handler.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This makes it easier to clear old media out at a later date
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
When we proxy a media request to a remote server, add a query-param, which will
tell the remote server to 404 if it doesn't recognise the server_name.
This should fix a routing loop where the server keeps forwarding back to
itself.
Also improves the error handling on remote media fetches, so that we don't
always return a rather obscure 502.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This is to inform browsers that they should sandbox the returned
media. This is particularly cruical for javascript/HTML files.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
This is so that a single MediaRepository can be shared across all
resources, rather than having a "copy" per resource.
In particular this allows us to guard against both the thumbnail and
download resource triggering a download of remote content at the same
time.
|
| |
|
|
|
|
| |
name in Content Disposition
|
| |
|
|
|
|
| |
wrapper decorator
|
|
|