Description
When a message with an image attached is sent to a room, hookshot's webhook doesn't contain the media file, just mxs://
reference in the event json.
hookshot version: 5.4.2
matrix-synapse version: 1.124.0
(both from NixOS 24.11)
According to my research, this is probably because Synapse enforces Authenticated Media by default and I would prefer not to disable it.
What I found:
Hookshot debug log contains
[OutboundHookConnection] Failed to get media for $<random> in !<room-id>:<example.com> <ref *2> IncomingMessage {...
and
_header: 'GET /_matrix/media/v3/download/<example.com>/<media-id>?allow_remote=true HTTP/1.1\r\n'
which is the "old" media API URL. Authenticated Media API should instead use
GET /_matrix/client/v1/media/download/{serverName}/{mediaId}
The request is ultimately generated by matrix-bot-sdk
method downloadContent
which has the "old" API path hardcoded. The bot sdk last release apparently predates MSC3916.
Activity
jficz commentedon Mar 5, 2025
There is a workaround if anyone needs it - if your home server is behind a reverse proxy, you can do something like
This will work so long as your clients which use the "old" endpoint also send authorization token with the requests which, fortunately, Hooshot does.