Files
dotnet-runtime/src/libraries/System.Net.Http/tests
stephentoub f44dff3e55 Fix CurlHandler Content-Length handling
CurlHandler was explicitly setting the Content-Length header, which overrides libcurl's default handling of Content-Length.  This means that  Content-Length was being sent even when it shouldn't have been, such as when redirecting a POST to a GET.  This commit changes how we handle Content-Length.  Rather than explicitly setting the header ourselves, we let libcurl do it, and we tell it the length of the input via the INFILESIZE and POSTFIELDSIZE options.

A few other issues addressed as well in the act of fixing this:
- A SafeHandle wasn't being disposed of in the case of a redirect.
- 301 wasn't being considered a redirect status code for the purposes of credential handling.
- Some code could have been a bit cleaner.


Commit migrated from https://github.com/dotnet/corefx/commit/864f0926754fbb781b81b543f972e069f6295a0c
2016-04-04 19:06:33 -04:00
..