Skip to content

Commit

Permalink
Use Uri.AbsolteUri instead of Uri.ToString().
Browse files Browse the repository at this point in the history
  • Loading branch information
kpreisser committed Nov 25, 2020
1 parent 904b8dc commit 2a2b441
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions SimpleSocketClient/UiSocketHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,17 @@ public void Start()
{
if (this.isWebsocket)
{
// Use Uri.AbsoluteUri instead of Uri.ToString() as the latter unescapes
// characters and thus could return a string e.g. with spaces and non-ASCII
// characters.
this.OnSocketMessage(new SocketMessageEventArgs(
$"Connecting to WebSocket URL '{this.webSocketUrl}'…",
$"Connecting to WebSocket URL '{this.webSocketUrl!.AbsoluteUri}'…",
isMetaText: true));
}
else
{
this.OnSocketMessage(new SocketMessageEventArgs(
$"Connecting to '{host}:{port}'…",
$"Connecting to '{this.host}:{this.port}'…",
isMetaText: true));
}

Expand Down

0 comments on commit 2a2b441

Please sign in to comment.