Branch: Tag:

2016-02-16

2016-02-16 11:06:42 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Standards.URI: Support userinfo containing '@'.

It is not uncommon for the user string to be an email adress...

56:   {    string host_port = authority;    // authority = [ userinfo "@" ] host [ ":" port ] -  if(sscanf(authority, "%[^@]@%s", string userinfo, host_port) == 2) -  { +  array(string) a = authority/"@"; +  if (sizeof(a) > 1) { +  host_port = a[-1]; +  string userinfo = a[..<1] * "@";    // userinfo = *( unreserved / pct-encoded / sub-delims / ":" )    sscanf(userinfo, "%[^:]:%s", user, password); // user info present    DEBUG("parse_authority(): user=%O, password=%O", user, password);