This fixes a bug found with chunked uploads using custom content that repeatedly calls Flush() on the stream passed into SerializeToStreamAsync.
This bug was discovered by WCF tests and reported via GitHub: https://github.com/dotnet/corefx/issues/2897
It was a mistake to use the Flush() method on the stream to send the final terminating chunk for the upload since that method can be called by custom content via the SerializeToStreamAsync method. The typical use pattern is that depending on the actual streams involved, upper layer software typically can call Flush() one or more times when writing to a stream. The fix here is to simply leave Flush() as a no-op (which it basically is for the WinHttpRequestStream) and have an internal method to handle the writing of the final terminating chunk.
This fix is being checked into TFS instead of using a GitHub PR. The reason is that the tests for this need to use our current internal server that correctly echoes the request headers in order to verify 'Transfer-Encoding: chunked' was sent by the client. I tried to put this test into the current GitHub tests using the current "http://httpbin.org" test server, but I discovered that httpbin.org doesn't properly echo the request headers when 'Transfer-Encoding' is sent. Instead, it ends up replacing that header and sending back 'Content-Length' (even though we didn't send that in the request headers). We have a backlog work item to port our remaining ToF tests to GitHub over the next several weeks.
[tfs-changeset: 1516976]
Commit migrated from https://github.com/dotnet/corefx/commit/ac9e5d9426ce28216a9d49d0753c8790e7aac0d2
This change updates the assembly versions of all of the corefx assemblies
as needed after we shipped stable versions. Assemblies with API differences
get a minor version bump. Assemblies with only bugfixes get a build version
bump.
In order to facilitate this I had to update the reference assemblies, so I took
the opportunity to port them all to the open.
[tfs-changeset: 1514419]
Commit migrated from https://github.com/dotnet/corefx/commit/40723b795917f2e98b64d45c17effb2546dd0cae
The stable versioned packages use an older codebase currently than the latest pre-release.
That codebase is still using SecureString in System.Private.Networking, but the dependency
was omitted since crypto is still pre-release but networking had to be marked stable for UWP.
This missing dependency was causing tests to fail.
Rather than just list the dependency I am moving these tests back to pre-release packages
for the System.Net contracts, since System.Net packages are under active development
it is better to have the tests running against latest than the stable bits.
Once we have newer versions published we'll update these tests to use those.
Commit migrated from https://github.com/dotnet/corefx/commit/5d9f9d4c6ea450366c7b70af6e6006a401284d14
This change modifies the build to consume the stable version where available.
This disables building the dowlevel packages since we shipped them once as stable and we're done.
From here on out, we'll only build the latest version (except for a servicing event, which would
be handled by syncing to a hash).
I can't rev the package versions in the normal way yet (by modifying the assembly version of the contents)
because that turned out to be too big of a problem to tackle in this change. Instead I added a
parameter to the task that calculates package versions to do the rev for anything that was
stable, but only when building the package itself, not when calculating the dependencies.
This has the downside of not permitting a dependency on a incremented pre-release version if we've
shipped a stable version, but that is a small point in time problem until I can rev the assembly
versions.
[tfs-changeset: 1508664]
Commit migrated from https://github.com/dotnet/corefx/commit/ee1ec2891c7c65b46fa9dfb078636be503bb2a60
This change sets up the layout for having multiple test projects for
WinHttpHandler. It follows the current guidlines as well as working
within the BUILDTOOLS requirements of having ".Tests.csproj" for the
names of the projects.
Also, fixed up some cross-platform definitions in the solutions files
for Http and WinHttpHandler.
After this PR is done, we will be migrating a large set of http
functional tests to GitHub
Commit migrated from https://github.com/dotnet/corefx/commit/42d81c41175ab8832032a2a387b8dc58365604a9
As per the latest security review, this issue captures the following tasks in order to remove insecure automatic redirection of HTTPS -> HTTP in HttpClientHandler/WinHttpHandler. This will also match the current NETCore/NETNative behavior as well.
In general, the security guidance is to remove insecure patterns from new code/platforms. This helps the entire ecosystem become more secure while balancing the needs of app-compat.
1. Change the WinHttpHandler API surface to remove the AutomaticRedirectionPolicy enum 3-state value.
2. Change the name/type of the 'AutomaticRedirectionPolicy' property to 'bool AutomaticRedirection'. This matches the current Framework Design guidelines of fully spelling out words and the word pattern of the 'AutomaticDecompression' property.
3. The default for the AutomaticRedirection property will be true. This value means that all redirects will be followed automatically EXCEPT for https:// to http://. This behavior is different from .NET desktop where https:// to http:// redirects are also followed.
[tfs-changeset: 1498199]
Commit migrated from https://github.com/dotnet/corefx/commit/4c99b29d6718af2de6d5e53869c694054cae161b