mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 18:44:56 -04:00
fix broken avatar checks when server_name contains a port (#13927)
Fixes check_avatar_size_and_mime_type() to successfully update avatars on homeservers running on non-default ports which it would mistakenly treat as remote homeserver while validating the avatar's size and mime type. Signed-off-by: Ashish Kumar ashfame@users.noreply.github.com
This commit is contained in:
parent
86b7d9b886
commit
0cfbb35131
3 changed files with 55 additions and 1 deletions
|
@ -307,7 +307,11 @@ class ProfileHandler:
|
|||
if not self.max_avatar_size and not self.allowed_avatar_mimetypes:
|
||||
return True
|
||||
|
||||
server_name, _, media_id = parse_and_validate_mxc_uri(mxc)
|
||||
host, port, media_id = parse_and_validate_mxc_uri(mxc)
|
||||
if port is not None:
|
||||
server_name = host + ":" + str(port)
|
||||
else:
|
||||
server_name = host
|
||||
|
||||
if server_name == self.server_name:
|
||||
media_info = await self.store.get_local_media(media_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue