hifi / heisenbridge

a bouncer-style Matrix IRC bridge
MIT License
244 stars 34 forks source link

Use urljoin in mxc_to_url to avoid issues with extra slashes #251

Open viiru- opened 1 year ago

viiru- commented 1 year ago

Whether or not the URL returned from detect_public_endpoint includes a trailing slash varies depending on external factors (what the homeserver operator put in the well-known file, whether the user included a trailing slash on the command line). Use urljoin to avoid an extra slash regardless (the media URL path should not start with //_matrix/media/.