Commit Graph
14 Commits
Author SHA1 Message Date
David Shulman 946476a75e Improve security of AutomaticRedirection options for HttpClientHandler/WinHttpHandler
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
2015-07-07 08:32:37 -07:00
David Shulman 274e8af0d9 Merge pull request dotnet/corefx#2149 from davidsh/winhttphandler
Initial open source WinHttpHandler

Commit migrated from https://github.com/dotnet/corefx/commit/45f21225e88a9959c93293c87a4348b333e572dd
2015-06-26 17:18:01 -07:00
dotnet-bot c07d246c4d Initial open source of WinHttpHandler
Commit migrated from https://github.com/dotnet/corefx/commit/bbe092e0d2edad89df1e4dfc2fb7cfdc4656f3a1
2015-06-26 16:09:07 -07:00
Nick Guerrera 4c28436d2e Update package dependency versions
Commit migrated from https://github.com/dotnet/corefx/commit/0c6b87e4e67e80b5d751bcd6883ca6e89fb68157
2015-06-24 14:04:15 -07:00
David Shulman c815caf6f2 Merge pull request dotnet/corefx#2139 from dotnet-bot/from-tfs
Merge changes from TFS

Commit migrated from https://github.com/dotnet/corefx/commit/25adee3ca74d2af65230456f7735f90fc13c679d
2015-06-23 17:50:55 -07:00
Matt Mitchell 9d11745057 Update build tools. Contains changes to support FreeBSD in xunit.
Float package versions to get the latest version of the netcore extensions (has FreeBSD support)


Commit migrated from https://github.com/dotnet/corefx/commit/c760824a531ffc3981148a8ef9b97f56af9ff643
2015-06-23 16:06:50 -07:00
David Shulman a406491c04 Remove unused WinHttpHandler.MaxRequestContentBufferSize property
This property has been effectively deprecated. It was left unimplemented in WinHttpHandler until we realized that we should remove it from the public WinHttpHandler contract.

In the .NET Desktop, the equivalent HttpClientHandler.MaxRequestContentBufferSize property was only used when the handler needed to automatically buffer the request content. That only happened if neither 'Content-Length' nor 'Transfer-Encoding: chunked' request headers were specified. The advice to developers is to always be precise with the headers and explicitly choose the transfer mechanism. So, this condition is an edge case.

When left ambiguous, the handler thus needed to buffer in the request content to determine its length and then would choose 'Content-Length' semantics when POST'ing.

In CoreCLR and .NETNative, the handler will resolve the ambiguity by always choosing 'Transfer-Encoding: chunked'. The handler will never automatically buffer in the request content.

[tfs-changeset: 1492780]


Commit migrated from https://github.com/dotnet/corefx/commit/1183c8183fb25c6f577e91c72bdcd0036fd2ef05
2015-06-23 14:13:24 -07:00
Matt Mitchell ddfcf96e4d Fixes issues with the System.Net.Http tests
* Tests were not running because the directories were not named properly.
* Rename test project to match the correct name.
* Fix typo in resource strings.


Commit migrated from https://github.com/dotnet/corefx/commit/36b6d6bfffe8e4994820109636af96cb9e6f39cb
2015-06-23 08:58:52 -07:00
Eric StJohn 1a58e04134 Update corefx packages to version 23011
Commit migrated from https://github.com/dotnet/corefx/commit/3bb2f035a7c1f6168a6bd34fbf3851f7eedf76bf
2015-06-19 16:33:53 -07:00
Justin Van Patten 0e22273fe0 System.Net.Http: String.Compare -> String.Equals
Per the Best Practices for Using Strings at
http://msdn.microsoft.com/en-us/library/dd465121(v=vs.110).aspx

* Use an overload of the String.Equals method to test whether two
strings are equal.
* Use the String.Compare and String.CompareTo methods to sort strings,
not to check for equality.

Also, replaced String.ToLowerInvariant().GetHashCode() with
StringComparer.OrdinalIgnoreCase.GetHashCode().


Commit migrated from https://github.com/dotnet/corefx/commit/423d73e086533aefcd142d8aa17eb300d79435d6
2015-06-11 19:58:09 -07:00
stephentoub 68b0c18d2d Update all project.lock.json files
Used:
build.cmd /t:RestorePackage /p:LockDependencies=true


Commit migrated from https://github.com/dotnet/corefx/commit/76fcb7ab9444f68577ca0ec17055ca8c4e574b75
2015-06-10 10:19:11 -04:00
dotnet-bot d3436011d2 Add System.Net.Http unit tests
Commit migrated from https://github.com/dotnet/corefx/commit/ee18ab6acf4d08109baf627310242f1f05c4b912
2015-06-01 10:41:07 -07:00
David Shulman 3bcc855204 Set default value of HTTP protocol version in NETNative to HTTP 2.0 .
Since the underlying HTTP stack in NETNative (Windows.Web.Http) supports HTTP/2.0, we are changing the default value HttpRequestMessage.Version property to 2.0.  HTTP requests sent to servers that don't actually support HTTP/2.0 will result in the connection operating with HTTP/1.1.

[tfs-changeset: 1478638]


Commit migrated from https://github.com/dotnet/corefx/commit/7c551c4ff3cd312e60082f454660962932f53b7b
2015-05-28 14:31:54 -07:00
David Shulman 27b7e18793 Initial open sourcing of System.Net.Http code.
This first commit does not include buildable CSPROJ/SLN files yet nor tests.  Those will be coming soon.

[tfs-changeset: 1462281]


Commit migrated from https://github.com/dotnet/corefx/commit/38140d6082ef5d3bca44533495bef623701cdfda
2015-04-29 14:19:31 -07:00