Skip to content

Commit 9e06ec4

Browse files
authored
Clarify matrix.to RFC 3986 percent encoding requirements (#2395)
1 parent 86396b4 commit 9e06ec4

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Clarify matrix.to RFC 3986 percent encoding requirements. Contributed by @HarHarLinks.

content/appendices.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -900,14 +900,22 @@ room alias, the client may open a view for the user to participate in
900900
the room.
901901

902902
The components of the matrix.to URI (`<identifier>` and
903-
`<extra parameter>`) are to be percent-encoded as per RFC 3986.
903+
`<extra parameter>`) MUST be percent-encoded as per RFC 3986.
904904

905905
Examples of matrix.to URIs are:
906906

907907
<!-- Author's note: These examples should be consistent with the matrix scheme counterparts. -->
908+
* Link to `#somewhere:example.org`: `https://matrix.to/#/%23somewhere:example.org`
909+
* Link to `!somewhere:example.org`: `https://matrix.to/#/!somewhere:example.org?via=elsewhere.ca`
910+
* Link to `$event` in `!somewhere:example.org`: `https://matrix.to/#/!somewhere:example.org/$event:example.org?via=elsewhere.ca`
911+
* Link to `@alice:example.org`: `https://matrix.to/#/@alice:example.org`
912+
913+
Note that encoding of characters is REQUIRED by RFC 3986 when they could otherwise be misinterpreted, and OPTIONAL for any other character.
914+
Hence the following encoding is also valid:
915+
908916
* Link to `#somewhere:example.org`: `https://matrix.to/#/%23somewhere%3Aexample.org`
909-
* Link to `!somewhere:example.org`: `https://matrix.to/#/!somewhere%3Aexample.org?via=elsewhere.ca`
910-
* Link to `$event` in `!somewhere:example.org`: `https://matrix.to/#/!somewhere%3Aexample.org/%24event%3Aexample.org?via=elsewhere.ca`
917+
* Link to `!somewhere:example.org`: `https://matrix.to/#/%21somewhere%3Aexample.org?via=elsewhere.ca`
918+
* Link to `$event` in `!somewhere:example.org`: `https://matrix.to/#/%21somewhere%3Aexample.org/%24event%3Aexample.org?via=elsewhere.ca`
911919
* Link to `@alice:example.org`: `https://matrix.to/#/%40alice%3Aexample.org`
912920

913921
{{% boxes/note %}}

0 commit comments

Comments
 (0)