synapse/tests/media
Shay 429ecb7564
Handle remote download responses with UNKNOWN_LENGTH more gracefully (#17439)
Prior to this PR, remote downloads which did not provide a
`content-length` were decremented from the remote download ratelimiter
at the max allowable size, leading to excessive ratelimiting - see
https://github.com/element-hq/synapse/issues/17394.

This PR adds a linearizer to limit concurrent remote downloads to 6 per
IP address, and decrements remote downloads without a `content-length`
from the ratelimiter *after* the download is complete and the response
length is known.

Also adds logic to ensure that responses with a known length respect the
`max_download_size`.
2024-07-16 11:13:55 +01:00
..
__init__.py
test_base.py
test_filepath.py
test_html_preview.py
test_media_retention.py
test_media_storage.py Handle remote download responses with UNKNOWN_LENGTH more gracefully (#17439) 2024-07-16 11:13:55 +01:00
test_oembed.py
test_url_previewer.py