-
lovetox
singpolyma, https://www.rfc-editor.org/rfc/rfc5122.html#section-2.2 > Certain characters are allowed in XMPP node identifiers and XMPP > resource identifiers but not in the relevant portion of an IRI or > URI. The characters are as follows: > > In node identifiers: [ \ ] ^ ` { | } > > In resource identifiers: " < > [ \ ] ^ ` { | } > > The node identifier characters are not allowed in userinfo by the > sub-delims rule and the resource identifier characters are not > allowed in segment by the pchar rule. These characters MUST be > percent-encoded when transforming an XMPP address into an XMPP IRI or > URI.
-
lovetox
so "xmpp:foo\40example.com@otherexample.com" is not a valid IRI
-
lovetox
because \ is not percent encoded
-
singpolyma
lovetox: sure that's possible. But the browser is percent encoding it anyway so that's not the main source of the issue here
-
lovetox
Gajim does treat it like a JID, and not as a IRI I fixed that
-
dwd
> I thought you mean eg xmpp: someone%40example.com which is ok if course I mean, it probably works, but technically it's not right.
-
lovetox
its not right i think, and Gajim would not parse this
-
lovetox
@ as delimiter between node and domain, is not to be percent encoded, this would prevent a parser from splitting the jid into its parts
-
singpolyma
you can percent encode every single char in a URI if you want
-
singpolyma
a correct parser will decode every encoded thing
-
singpolyma
and so it will still be an @ by the time it hits the jid parser
-
singpolyma
dwd: In what way would you think it's not right?
-
lovetox
i was talking about a IRI
-
lovetox
thats what we use normally in xmpp environment, no need to convert something to a URI
-
lovetox
Gajim has no support for the URI form
-
singpolyma
Those are equivalent for this purpose, IRI vs URI. They use the same escaping
-
lovetox
no seems not if you say you can percent encode everything on a URI
-
lovetox
the IRI spec is quite clear to me, and it nowhere says to percent encode the @ in an xmpp address
-
lovetox
there are to capitals on processing and iri and generating an iri, and all it says is to encode by inode, ires, ihost rules
-
lovetox
and respectively decode by these rules, but if you encode the @ you cannot get node and host, because jid splitting does not work anymore
-
singpolyma
I don't understand. The @ is not special at all. Why wouldn't you be able to encode it?
-
singpolyma
You split on the @ once you have the jid you are parsing. That's not part of the IRI syntax
-
lovetox
what do you mean by its not special? there is a syntax to create a iri, and it says to place a @ between node and host
-
lovetox
nowhere does it say to percent encode it later
-
singpolyma
Ah I see, rfc5122 makes it special even though it normally wouldn't be. Interesting. So if you specifically support xmpp IRI then technically it's special even though if you use a generic IRI parser it will work. Hence dwd's "probably works but technically wrong"
-
lovetox
i implemented the iri syntax because thats what we usually use to share, URI make not much sense in context of sending xmpp links. And there is a special paragraph of transforming and IRI to URI and back, but i read that, and it was complicated enough that i didnt want to consider it
-
lovetox
the problem with that is that most implementors do url_encode("xmpp:" + JID)
-
lovetox
and think thats valid
-
singpolyma
IRI vs URI isn't relevant in most contexts yeah
-
singpolyma
What's different here is generic IRI syntax vs rfc5122 syntax
-
lovetox
yeah i dont understand the use case where it would, so i would try to agree that we all use IRI, or someone eli5 to me how that conversion from URI to IRI works :)
-
singpolyma
URI vs IRI is just about Unicode or not
-
lovetox
ah, because IRI allows unicode chars
-
lovetox
and URI percent encodes them all
-
singpolyma
Yes
-
singpolyma
That's all