Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Room URLs are technically invalid #1903

Open
ara4n opened this issue Mar 31, 2017 · 8 comments
Open

Room URLs are technically invalid #1903

ara4n opened this issue Mar 31, 2017 · 8 comments
Labels
O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect

Comments

@ara4n
Copy link
Member

ara4n commented Mar 31, 2017

You're technically not allowed to have unescaped # symbols in a URL fragment, like we do for URLs like https://riot.im/app/#/room/#matrix:matrix.org. This causes problems for some conservative URL parsers like Ruby's, who appear not to have heard of Postel's law O:-) - see general unhappiness over at https://meta.discourse.org/t/broken-links-blank-page-with-appearing-in-url/52640/11.

To fix this I suggest we switch matrix.to to using compact URLs by default - i.e. solving matrix-org/matrix.to#17, and then given people generally shouldn't be passing around riot URLs anyway, it's not a disaster if we encode the URLs 'correctly' with a %23 in them.

Or alternatively we can be thoroughly evil and encode them with a http://www.fileformat.info/info/unicode/char/2317/index.htm instead of a # :>

@lampholder lampholder added X-Needs-Info This issue is blocked awaiting information from the reporter P2 labels Apr 6, 2017
@lampholder
Copy link
Member

Do we have everything we need to move forward with this? Are we free to move forward with implementing:

https://matrix.to/#room:domain.tld
and
https://matrix.to/@user:domain.tld

If there are outstanding questions about the @user form, can we still move forward with the #room links independently?

@ara4n
Copy link
Member Author

ara4n commented Apr 6, 2017

technically @ is illegal there, but ruby doesn't choke on it. So i am inclined to go with it anyway, and if people complain further we can always provide a https://matrix.to/u/matthew:matrix.org style workaround or something horrid.

@ara4n ara4n added T-Defect S-Minor Impairs non-critical functionality or suitable workarounds exist and removed X-Needs-Info This issue is blocked awaiting information from the reporter labels Apr 23, 2017
@martindale
Copy link

Why not just example.com/rooms#name:domain.tld?

@t3chguy
Copy link
Member

t3chguy commented Sep 8, 2018

Because then you need to configure your Web server to serve the file for subpaths and not only the root

@martindale
Copy link

You're requiring a web server in the first place, of course it needs to be configured. It seems to solve several issues at once without any drawbacks.

@t3chguy
Copy link
Member

t3chguy commented Sep 9, 2018

Riot-web doesn't require a Web server, you can just browse a filesystem copy using browsers file:// protocol

@bkil
Copy link

bkil commented Sep 14, 2022

Replying to the original issue @ara4n . Could you please cite the section that states that you can't have # or @ within your anchor? I have an artistic project in which I generate most every character in the anchor and I would be very sad if parsers started making additional assumptions upon how a URI could or should be structured. (Yes, I'm looking at the markdown parser and the autolinker within Element breaking my links without additional mitigation, but that's a topic for a different room)

https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Syntax

: and @ may appear unencoded within the path, query, and fragment; and ? and / may appear unencoded as data within the query or fragment

The RFC actually defines a sane interpretation for using reserved characters unencoded:

If a reserved character is found in a URI component and no delimiting role is known for that character, then it must be interpreted as representing the data octet corresponding to that character's encoding in US-ASCII.

Incidentally, I myself have opted to always escape # for a different reason: my payload can be present in either the fragment or the query according to the desire of the user.

@SimonBrandner SimonBrandner added O-Occasional Affects or can be seen by some users regularly or most users rarely and removed P2 labels Sep 15, 2022
@bkil
Copy link

bkil commented May 30, 2023

@t3chguy t3chguy transferred this issue from element-hq/element-web Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect
Projects
None yet
Development

No branches or pull requests

6 participants