pusher / pusher-websocket-dotnet

Pusher Channels Client Library for .NET
MIT License
112 stars 113 forks source link

HttpAuthorizer returns incorrect auth token #78

Closed tyronent closed 4 years ago

tyronent commented 4 years ago

When I run the ExampleApplication I am getting the following error:

"JsonReaderException: Unexpected character encountered while parsing value: S. Path '', line 0, position 0"

Upon further investigation it seems that the error is caused at HttpAuthorizer.Authorize():

authToken = response.Content.ToString();

returns "System.Net.Http.StreamContent" instead of the actual response.

For this to work the line needs to be changed to: authToken = response.Content.ReadAsStringAsync().Result;

Is this a known issue?

Note: I am using .net 4.6.1