nopara73 / DotNetTor

Library implementation of essential Tor features in .NET Core.
https://www.nuget.org/packages/DotNetTor
MIT License
77 stars 21 forks source link

Added test for non ascii chars #10

Closed mikeapple closed 6 years ago

mikeapple commented 6 years ago

Actually, I just copied and pasted that test and added the other chars. VS for Mac is still weird with running tests (gotta love it though)...

I've just run that test and it does return but changing it to use StringContent like I mentioned in the issue causes the problem. So change the test to be

        using (_client = new HttpClient(new SocksPortHandler()))
        {
            string json = "Hello ñ";
            var httpContent = new StringContent(json, Encoding.UTF8, "application/json");

            HttpResponseMessage message = await _client.PostAsync("http://httpbin.org/post", httpContent).ConfigureAwait(false);
            var responseContentString = await message.Content.ReadAsStringAsync().ConfigureAwait(false);

        }
nopara73 commented 6 years ago

I will look into it tomorrow.

mikeapple commented 6 years ago

Great, thanks. I'll keep looking at it too.

nopara73 commented 6 years ago

The code you inserted here must returh this: "Hello \u00f1", since this is what HTTPClient returns. I believe there is a way to read it properly, but that's outside the scope of this issue. However the code with Tor hangs. That's the issue.

mikeapple commented 6 years ago

Sorry yes, the test was just a copy and paste. I've fixed the hanging issue with my latest PR and it returns "Hello \u00f1" without hanging.