Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Providing avatar_url in PUT /_synapse/admin/v2/users/<user_id> will cause the request to fail #8871

@Half-Shot

Description

@Half-Shot
2020-12-03 17:54:46,740 - synapse.http.server - 79 - ERROR - PUT-4829- Failed handle request via 'UserRestServletV2': <XForwardedForRequest at 0x7fea0361d880 method='PUT' uri='/_synapse/admin/v2/users/%40demo2_fake%3Ahs-mi1-staging.ems.host' clientproto='HTTP/1.1' site=8008>
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/synapse/http/server.py", line 228, in _async_render_wrapper
    callback_return = await self._async_render(request)
  File "/usr/local/lib/python3.8/site-packages/synapse/http/server.py", line 405, in _async_render
    callback_return = await raw_callback_return
  File "/usr/local/lib/python3.8/site-packages/synapse/rest/admin/users.py", line 321, in on_PUT
    await self.profile_handler.set_avatar_url(
  File "/usr/local/lib/python3.8/site-packages/synapse/handlers/profile.py", line 264, in set_avatar_url
    if not self.hs.is_mine(target_user):
  File "/usr/local/lib/python3.8/site-packages/synapse/server.py", line 297, in is_mine
    return domain_specific_string.domain == self.hostname
AttributeError: 'str' object has no attribute 'domain'

if "avatar_url" in body and type(body["avatar_url"]) == str:
await self.profile_handler.set_avatar_url(
target_user, requester, body["avatar_url"], True
)

Synapse 1.23.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions