matrix-org / matrix-appservice-bridge

Bridging infrastructure for Application Services
Apache License 2.0
153 stars 73 forks source link

MediaProxy fails with https homeserver.url #507

Closed heftig closed 3 weeks ago

heftig commented 3 weeks ago

After upgrading the IRC bridge from 2.0.1 to 3.0.1, the media URLs provided to IRC no longer work. The proxy returns a 500 Internal Server Error with content {"errcode":"M_AS_UNKNOWN","error":"An internal error occured"}.

The logs contain:

Sep 09 04:00:27 matrix.archlinux.org node[701]: ERROR 04:00:27:536 [MediaProxy] TypeError [ERR_INVALID_PROTOCOL]: Protocol "https:" not supported. Expected "http:"
Sep 09 04:00:27 matrix.archlinux.org node[701]:     at new ClientRequest (node:_http_client:194:11)
Sep 09 04:00:27 matrix.archlinux.org node[701]:     at request (node:http:103:10)
Sep 09 04:00:27 matrix.archlinux.org node[701]:     at get (node:http:114:15)
Sep 09 04:00:27 matrix.archlinux.org node[701]:     at /var/lib/synapse/matrix-appservice-irc/node_modules/matrix-appservice-bridge/lib/components/media-proxy.js:151:28
Sep 09 04:00:27 matrix.archlinux.org node[701]:     at new Promise (<anonymous>)
Sep 09 04:00:27 matrix.archlinux.org node[701]:     at MediaProxy.onMediaRequest (/var/lib/synapse/matrix-appservice-irc/node_modules/matrix-appservice-bridge/lib/components/media-proxy.js:150:16)
Sep 09 04:00:27 matrix.archlinux.org node[701]:     at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
Sep 09 04:00:27 matrix.archlinux.org node[701]:   code: 'ERR_INVALID_PROTOCOL'
Sep 09 04:00:27 matrix.archlinux.org node[701]: }
mweinelt commented 3 weeks ago

This breaks media for the hackint IRC bridge. Can someone PTAL.

@Half-Shot @tadzik

tadzik commented 2 weeks ago

Should be all good now in https://github.com/matrix-org/matrix-appservice-irc/releases/tag/3.0.2.

Thanks for your report!