* Move uap, uapaot, netfx and netcoreapp constant definitions to top-level build file.
* Trying to fix compilation of PerformanceCounterLib for netcoreapp2.0 targets.
* Change netcoreapp definition to mean the current version only.
* Fix conflict in System.Private.DataContractSerialization.csproj.
* Revert change in src/shims/manual/Directory.Build.props.
* Fix condition in test.
* Bring back TargetsNetCoreApp, it was lost during rebases.
* Move definition of netstandard to top-level build file. Remove more netcoreapp/uap definitions from individual files.
* Fix vbproj compatibility.
* Address PR review and unify the definitions to use TargetGroup directly.
* Add back one "netstandard" definition.
Commit migrated from https://github.com/dotnet/corefx/commit/ac994544e749eac3e85b60bf0012ae2f85ae0e49
Yesterday I made an optimization in several places to avoid unnecessary Int32.ToString calls / string allocations. Most of them were valid. However, even though valid Cache-Control headers don't contain negative values and are properly caught by the parser parsing incoming headers, the setters on CacheControlHeaderValue allow negative values to be specified without validation. If such negative values were used, my change made it so that in a culture where the current culture's NumberFormatInfo.NegativeSign is not "-", the wrong negative sign would be used when rendering. This commit fixes that and adds a regression test.
Commit migrated from https://github.com/dotnet/corefx/commit/cea9971b75665f0c9d1c3f254c4fa8c58c7d494a
* Add implementation to common
* Shift System.Net.Http to use common HttpDateParser
* Clean up whitespace in affected areas of System.Net.Requests
* Update System.Net.Request to use common Http date parsing
* Switch to InvariantCulture in tests
* Specify type.
* Remove unneeded file.
* Remove unneeded parameter
* Don't cache parameters.
* Let 'r' be handled like in System.Net.Http
System.Net.Http handled the 'r' format by letting a format string that didn't require leading zeros to be used, meaning one format string can be removed from consideration.
Commit migrated from https://github.com/dotnet/corefx/commit/deee13b99d441cf1906397c54d0c5afcf8385d92
* add bypass list processing
* remove 10.37.129.2
* update assembly references
* add bypass list processing
* remove 10.37.129.2
* update assembly references
* use Regex.Escape to escape . and [. Add more test cases.
* feedback from reviews
* fix some of the style comments. more changes to come.
* feedback from @stephentoub
* use UriHostNameType and IdnHost consistently to possibly avoid allocations. Add new test for various unexpected input
* replace String.Compare with string.Compare
Commit migrated from https://github.com/dotnet/corefx/commit/c9d1ec1764f421f35cfe0bbc71bf2f81bc8f0f8d
This PR addresses some error handling problems in WinHttpHandler as well as
improves the error messages generated for WinHttpException.
This was root caused to a bug in WinHttp where it can't do a GET request with a
request body using chunked encoding. However, this exception was masked due to
an error handling bug caused by an inconsistency in how WinHttp associates
context values for callbacks during the WinHttpSendRequest API call. This PR now
fixes the error handling around synchronous errors being returned from
WinHttpSendRequest. The root WinHttp bug itself can't be fixed. So, doing a GET request
will still throw an exception, but it will be a catchable HttpRequestException.
Another bug was discovered while investigating dotnet/corefx#26278. WinHttpCloseHandle should only be
called once and should never race between threads. This is normally protected when
the request handle is closed via SafeHandle Dispose(). But there was a place in the
callback method where we called WinHttpCloseHandle directly against the raw handle.
Finally, the error messages for WinHttpExceptions have been improved to show the
error number and the probable WinHttp API call that generated the error. This will
save diagnostic time.
I also moved the WinHttpException source code back from Common. It was originally shared
between WinHttpHandler and ClientWebSocket. But then ClientWebSocket moved away from
WinHttp implementation. So, it makes more sense for this class to be under WinHttpHandler.
Example:
Original WinHttpException message: "The parameter is incorrect"
New WinHttpException message: "Error 87 calling WinHttpSendRequest, 'The parameter is incorrect'."
Closesdotnet/corefx#28156
Contributes to dotnet/corefx#26278
Commit migrated from https://github.com/dotnet/corefx/commit/ce4ebdfbf2080a38855ab8df5c9bb553db8724af
With the expectation that we'll want to expose this in 2.1, implement Expect100ContinueTimeout and ConnectTimeout. The members are currently internal but can be flipped public easily once the APIs are approved. This also fixes an issue with cancellation around the connect phase, where a cancellation request that came in during the SSL auth phase would not be respected.
Commit migrated from https://github.com/dotnet/corefx/commit/01fa16ffd618846a913cad719269c8bb441ceb28
- Renames ManagedHandler to SocketsHttpHandler
- Moves a bunch of files around accordingly
- Updates System.Net.WebSockets.Client to use SocketsHttpHandler directly
- Updates System.Net.Http's tests with a reflection-based rather than TLS-based method for instantiating an HttpClientHandler backed by a SocketsHttpHandler.
Commit migrated from https://github.com/dotnet/corefx/commit/852d40e723c849e8d0c486676d40332343e12ca5
* initial attempt
* remove extra debug message and cleanup.
* take feedabck from reviews
* adress comments from review and add unit tests
* add missing variables to cleanup function
* fix more style and review comments
* updates suggested by geoff
* few more places s/Credientials/Credentials/
* refactor credentials handling
* more fixes to address review feedback
* include HttpProxyConnectionHandler.*.cs only for netcoreapp
Commit migrated from https://github.com/dotnet/corefx/commit/454220d87dc118a6cb039ef5bd68707de20b79a5
- Add some arg validation to match existing CurlHandler
- Change some names to be consistent with CurlHandler
- Use expression-bodied syntax in a few places
- Ensure only one handler is published in the face of race conditions
Commit migrated from https://github.com/dotnet/corefx/commit/56e96a6841f1bdef5756dc886ec24028fd9576ee
- Add a ManagedHandler field to both the Windows and Unix HttpClientHandler builds, and change the members to switch based on which is being used. The default is still to use WinHttpHandler and CurlHandler respectively, but setting an environment variable prior to constructing an HttpClientHandler will switch it to use ManagedHandler.
- Add test classes that will run the tests again but with the managed handler. Some of the test classes are commented out due to current failures.
- Fixed a few tests.
Commit migrated from https://github.com/dotnet/corefx/commit/b238d0d760a2588513c443f3a4c991222fd037bb
* Enable tests to compile with netstandard
Most of the tests have netstandard configurations and it doesn't compile. the changes here is to fix the configurations and the tests to compile.
This is important step to get netfx tests compile too as we are in most of the time netfx fallback to netstandard configuration
The changes include some fixes to compile teh sources too.
* Fix System.Collections.Immutable
* update src configuration
* remove netstandard17 defines
* Split netcoreapp code to its own files
* Remove 17 from the test class name
Commit migrated from https://github.com/dotnet/corefx/commit/15b4f51c2f3cb924840e5407bb8d5fe03bb282ea