diff --git a/changelogs/client_server/newsfragments/3562.clarification b/changelogs/client_server/newsfragments/3562.clarification new file mode 100644 index 00000000..f7ac9b77 --- /dev/null +++ b/changelogs/client_server/newsfragments/3562.clarification @@ -0,0 +1 @@ +Clarify that `base_url` in client `well_known` may or may not include trailing slash. \ No newline at end of file diff --git a/content/client-server-api/_index.md b/content/client-server-api/_index.md index 675ac594..d87777e2 100644 --- a/content/client-server-api/_index.md +++ b/content/client-server-api/_index.md @@ -285,10 +285,10 @@ specify parameter values. The flow for this method is as follows: 1. If the content cannot be parsed, then `FAIL_PROMPT`. 4. Extract the `base_url` value from the `m.homeserver` property. This value is to be used as the base URL of the homeserver. - 1. If this value is not provided, then `FAIL_PROMPT`. + 1. If this value is not provided, then `FAIL_PROMPT`. 5. Validate the homeserver base URL: - 1. Parse it as a URL. If it is not a URL, then `FAIL_ERROR`. - 2. Clients SHOULD validate that the URL points to a valid + 1. Parse it as a URL. If it is not a URL, then `FAIL_ERROR`. + 2. Clients SHOULD validate that the URL points to a valid homeserver before accepting it by connecting to the [`/_matrix/client/versions`](/client-server-api/#get_matrixclientversions) endpoint, ensuring that it does not return an error, and parsing and validating that the @@ -297,6 +297,8 @@ specify parameter values. The flow for this method is as follows: done as a simple check against configuration errors, in order to ensure that the discovered address points to a valid homeserver. + 3. It is important to note that the `base_url` value might include + a trailing `/`. Consumers should be prepared to handle both cases. 6. If the `m.identity_server` property is present, extract the `base_url` value for use as the base URL of the identity server. Validation for this URL is done as in the step above, but using