Fix routing loop when fetching remote media
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.
Showing
- synapse/api/errors.py 52 additions, 7 deletionssynapse/api/errors.py
- synapse/http/matrixfederationclient.py 12 additions, 3 deletionssynapse/http/matrixfederationclient.py
- synapse/rest/media/v1/download_resource.py 12 additions, 0 deletionssynapse/rest/media/v1/download_resource.py
- synapse/rest/media/v1/media_repository.py 26 additions, 4 deletionssynapse/rest/media/v1/media_repository.py
Loading
Please register or sign in to comment