MSC3074: Proposal for URIs conforming to RFC 3986 syntax. #3074
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
MSC 3074: Change Matrix URIs to conform to standard RFC 3986 syntax
I propose changing Matrix URLs to conform to standard URI syntax described in RFC 3986.
The Problem
Currently, Matrix URI syntax places resource information before the authority (host), in violation of the syntax described by RFC 3986 Section 3: Syntax. Because of this, URI parsing modules for all major languages do not work for Matrix URIs. For example, parsing the host using nodejs
require('url').parse('matrix://r/roomAlias:matrix.org')
does not work.The Solution
Change the Matrix URI syntax to conform to RFC 3986 Syntax:
RFC 3986 URI Syntax:
scheme:[//authority]path[?query][#fragment]
whereauthority = [userinfo@]host[:port]
Example of Matrix URIs using RFC 3986 Syntax:
User URLs:
@user:matrix.org
->user@matrix.org
Room Alias URLs:
#roomAlias:matrix.org
->matrix.org/rooms/roomAlias
Room ID URLs:
!roomId:matrix.org
->matrix.org/rooms?id=roomId
Event URLs:
$eventId:matrix.org
->matrix.org/events/eventId
Group URLs:
+groupId:matrix.org
->matrix.org/groups/groupId
Benefits
Common Objections
Matrix URIs do conform to standard syntax, because there is no authority.
Matrix URIs include authority (host) information for users and room aliases, which should come after the scheme in the standard. Currently, Matrix URIs put authority information after resource information.
This would be a big change, as Matrix URIs are widespread in Matrix code.
Yes, but the sooner this is done the less work it will be. All change in federated standards takes a lot of time and work. I don't think changes should be evaluated solely on this criteria.
Related MSCs
#2312 should be considered alongside this proposal