matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.83k stars 2.13k forks source link

Register media URLs via regex. #16419

Closed clokep closed 1 year ago

clokep commented 1 year ago

This essentially converts the media repo stuff from the Twisted-way of registering resources to the regex way of registering servlets.

I tested this via trying some URLs with v1, v3, r0; testing that options still works, etc.

Vaguely related to #5118.

This is desirable for #15503 where a new endpoint (/create) needs to be registered as v1 & the behavior of /upload is changed for /v3 (to support PUT in addition to POST).

clokep commented 1 year ago

This should actually be ready for a review now... the changes to the tests are really invasive, but I think they're overall better -- it means that we're not grabbing random resources and shoving requests into them but going through the routing path of Synapse.