diff options
author | Shay <hillerys@element.io> | 2024-06-05 05:43:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-05 13:43:36 +0100 |
commit | fcbc79bb87d08147e86dafa0fee5a9aec4d3fc23 (patch) | |
tree | 5d5efc029b3410f96ce9aa5dc49b55e7ef4755c5 /synapse/media/thumbnailer.py | |
parent | Handle hyphens in user dir search porperly (#17254) (diff) | |
download | synapse-fcbc79bb87d08147e86dafa0fee5a9aec4d3fc23.tar.xz |
Ratelimiting of remote media downloads (#17256)
Diffstat (limited to 'synapse/media/thumbnailer.py')
-rw-r--r-- | synapse/media/thumbnailer.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/media/thumbnailer.py b/synapse/media/thumbnailer.py index cc3acf51e1..f8a9560784 100644 --- a/synapse/media/thumbnailer.py +++ b/synapse/media/thumbnailer.py @@ -359,9 +359,10 @@ class ThumbnailProvider: desired_method: str, desired_type: str, max_timeout_ms: int, + ip_address: str, ) -> None: media_info = await self.media_repo.get_remote_media_info( - server_name, media_id, max_timeout_ms + server_name, media_id, max_timeout_ms, ip_address ) if not media_info: respond_404(request) @@ -422,12 +423,13 @@ class ThumbnailProvider: method: str, m_type: str, max_timeout_ms: int, + ip_address: str, ) -> None: # TODO: Don't download the whole remote file # We should proxy the thumbnail from the remote server instead of # downloading the remote file and generating our own thumbnails. media_info = await self.media_repo.get_remote_media_info( - server_name, media_id, max_timeout_ms + server_name, media_id, max_timeout_ms, ip_address ) if not media_info: return |