Make cross-server matrix puppetting possible#26
Conversation
Downstream libraries/code would need to persist `base_url` and make `allow_external_custom_puppets` toggleable for this
| if await validate_versions_api(base_url): | ||
| return base_url | ||
| elif await validate_versions_api(base_url + "/"): | ||
| return base_url + "/" |
There was a problem hiding this comment.
Related to #20, it's possible this can cause problems
There was a problem hiding this comment.
Is testing with a slash ever necessary? validate_versions_api will already add it if it's missing. It might be necessary to remove the slash if it's there though
There was a problem hiding this comment.
validate_versions_api does urllib.parse.urljoin(base_url, "_matrix/client/versions"), which, with an url like https://homeserver.com/subpath, can either result in https://homeserver.com/_matrix/client/versions being tested, or https://homeserver.com/subpath/_matrix/client/versions
Unfortunately, subpath ambiguity is not mentioned in the spec, so if a slash isn't placed, it can be either one of those two cases, technically speaking.
@tulir would you want me to move that
_discover_homeserver_endpointsomewhere else? If so, where exactly?Closes #25