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/.
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/
.