Oyatel / CometD.NET

CometD.NET is a C# client library for the Bayeux protocol
44 stars 34 forks source link

UTF Encoding issue when multi-byte characters are present #18

Open lukecarroll opened 11 years ago

lukecarroll commented 11 years ago

If a string in the JSON content contains any characters longer than one byte (ie non-ASCII), the byte array written to the stream in LongPollingTransport.GetRequestStreamCallback misses bytes due to the wrong length being passed to postStream.Write(). This results in a HTTP 400 Bad Request from the server due to malformed JSON.

I hadn't seen any activity on the project lately so I've forked CometD.NET and committed my fix - https://github.com/lukecarroll/CometD.NET/commit/2f170564fbbbe84d9baedf48a87377afb283866c

Cheers