Closed MateusMendesSantana closed 5 years ago
Really well-observed @MateusMendesSantana, I think we can use a ReplaceFirst
instead to prevent this from happening, like:
public static string ReplaceFirst(this string text, string search, string replace)
{
int pos = text.IndexOf(search);
if (pos < 0)
{
return text;
}
return text.Substring(0, pos) + replace + text.Substring(pos + search.Length);
}
Thank you @endel. Could be, I just did it:
req.url = uriBuilder.Uri.ToString().Replace("ws://", "http://");
I think the right thing would be to fragment the URI, separate the protocol, address and port. Mount the URI on request only
@MateusMendesSantana sounds better indeed! I'd gladly merge if you don't mind sending a PR <3
if (HasToken) query["token"] = Token;
Auth.cs, line 249// FIXME: replacing "ws" with "http" is too hacky! req.url = uriBuilder.Uri.ToString().Replace("ws", "http");
client token:
has been replaced by: