mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-08 01:55:06 -04:00
SYN-229: Include Content-Length when downloading files
This commit is contained in:
parent
0e93e01fcb
commit
3c8c3bf3b7
3 changed files with 23 additions and 7 deletions
|
@ -100,11 +100,12 @@ class ThumbnailResource(BaseMediaResource):
|
|||
t_type = thumbnail_info["thumbnail_type"]
|
||||
t_method = thumbnail_info["thumbnail_method"]
|
||||
file_id = thumbnail_info["filesystem_id"]
|
||||
t_length = thumbnail_info["thumbnail_length"]
|
||||
|
||||
file_path = self.filepaths.remote_media_thumbnail(
|
||||
server_name, file_id, t_width, t_height, t_type, t_method,
|
||||
)
|
||||
yield self._respond_with_file(request, t_type, file_path)
|
||||
yield self._respond_with_file(request, t_type, file_path, t_length)
|
||||
else:
|
||||
yield self._respond_default_thumbnail(
|
||||
request, media_info, width, height, method, m_type,
|
||||
|
@ -139,11 +140,12 @@ class ThumbnailResource(BaseMediaResource):
|
|||
t_height = thumbnail_info["thumbnail_height"]
|
||||
t_type = thumbnail_info["thumbnail_type"]
|
||||
t_method = thumbnail_info["thumbnail_method"]
|
||||
t_length = thumbnail_info["thumbnail_length"]
|
||||
|
||||
file_path = self.filepaths.default_thumbnail(
|
||||
top_level_type, sub_type, t_width, t_height, t_type, t_method,
|
||||
)
|
||||
yield self.respond_with_file(request, t_type, file_path)
|
||||
yield self.respond_with_file(request, t_type, file_path, t_length)
|
||||
|
||||
def _select_thumbnail(self, desired_width, desired_height, desired_method,
|
||||
desired_type, thumbnail_infos):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue