* Initial fix.
* Test improvements.
* Add comment explaining fix, revert testing change.
* Add new test validating the behavior for an invalid content-type header, add test case for empty string.
* Store headers.ContentType.CharSet to minimize repeated access.
* Clean up test to not rely on the loopback server.
* Switch test content to use characters outside of ASCII range. Disable test on netfx, since it doesn't have the fix implemented here.
Commit migrated from https://github.com/dotnet/corefx/commit/28e216680a990ce4a58798aa0d2026c9d3e1f148
Array.Copy is implemented to work with any System.Array, not just T[]. When Array.Copy(sourceArr, destArray, length) is used, it delegates to Copy(sourceArr, sourceIndex, destArray, destIndex, length), and as such needs to query for the lower-bound of the supplied arrays, since although a T[] in C# always has a lower-bound of 0, an arbitrary Array may not. Given this, when calling Array.Copy, instead of calling Array.Copy(src, dest, length), it's slightly more efficient to just call Array.Copy(src, 0, dest, 0, length), avoiding the need for the GetLowerBound calls made while delegating to the 5-arg version.
I noticed one occurrence of this in some code I was looking at, and while fixing that, I fixed all of them across corefx\src.
Commit migrated from https://github.com/dotnet/corefx/commit/979026e435672e611e3f6e0647c873aa96ccc684
Added more http tests to open source from the original internal ToF tests. Some of
the tests should be refactored in the future to avoid Assert'ing multiple
logical things.
Fixed up test namespaces for System.Net.Http and
System.Net.Http.WinHttpHandler.
Commit migrated from https://github.com/dotnet/corefx/commit/e5a017cb6ca01e99b1f1462298bc0cbf60c06ee0