These are chat archives for IndySockets/Indy

20th
Oct 2016
Jeroen Wiert Pluimers
@jpluimers
Oct 20 2016 16:07
Shouldn't TIdURI.GetFullURI escape : and @ in usernames/passwords ?
Matthijs ter Woord
@mterwoord
Oct 20 2016 16:22
@jpluimers Hi! :)
Kudzu
@czhower
Oct 20 2016 16:22
@ is legit in URLs becuase of auto login
so it would have no way to encode it without complicated parsing.
Matthijs ter Woord
@mterwoord
Oct 20 2016 16:23
does TIdURI let you specify a .Username and a.Password string?
Kudzu
@czhower
Oct 20 2016 16:23
same for : IIRC but would have to lok at spec
dont remember.. if they are separated out, then yes it should escape htem.
Matthijs ter Woord
@mterwoord
Oct 20 2016 16:23
last time i looked at delphi was today (fighting ole container, and stupid dev mistakes), last time before, no clue.. :)
this is interesting: c# doesn't do that..
var xUrl = new UriBuilder();
xUrl.Host = "localhost";
xUrl.UserName = "mterwoord@github.com";
xUrl.Password = "Pass:!@";

// xUrl.ToString() -> http://mterwoord@github.com:Pass:!@@localhost/
not trying to say that indy should match .net behavior per se, but worth investigating why that is...
(imo)
Ludwig Behm
@lbehm
Oct 20 2016 16:27
@czhower I think @jpluimers means @ in the username part of an uri - which should be escaped.
Jeroen Wiert Pluimers
@jpluimers
Oct 20 2016 16:28
I tried finding RFC info on this but my Google foo isn't helping much. There are some SO posts indicating %-hex escape but they don't make references to standards.
Matthijs ter Woord
@mterwoord
Oct 20 2016 16:28
you saw RFC 1738?
and maybe 2141 or 2396
Jeroen Wiert Pluimers
@jpluimers
Oct 20 2016 16:31
Indeed: https://tools.ietf.org/html/rfc1738#section-3.1 indicates @ : / need escaping.
Kudzu
@czhower
Oct 20 2016 16:31
yes tehy do
@rlebeau
Jeroen Wiert Pluimers
@jpluimers
Oct 20 2016 16:31
Which means .net is doing it wrong (:
Ludwig Behm
@lbehm
Oct 20 2016 16:33
@jpluimers: https://tools.ietf.org/html/rfc3986#section-3.2.1 allows only userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) which excludes @
Jeroen Wiert Pluimers
@jpluimers
Oct 20 2016 16:37
@devimplode oh nice: conflicting info (:
Ludwig Behm
@lbehm
Oct 20 2016 16:37
@jpluimers why?
Jeroen Wiert Pluimers
@jpluimers
Oct 20 2016 16:40
@devimplode disregard, I was sleeping while reading. Not a good combination (:
Remy Lebeau
@rlebeau
Oct 20 2016 16:40
The official syntax for URLs, which other formats are a subset of, is RFC 3986. Note that TIdURI is very old and doesn't follow very many parsing/encoding rules at all and was never RFC compliant. There are a lot of things it doesn't handle right. I have a replacement in works (TIdIRI) that implements RFC 3987, with descendants for scheme-specific RFCs, and will obsolute TIdURI.
Jeroen Wiert Pluimers
@jpluimers
Oct 20 2016 16:41
Great! Let me know when there is something testable.