Commit Graph
392 Commits
Author SHA1 Message Date
Filip Navara 2a2c2ef521 Move uap, uapaot, netfx, netcoreapp and netcoreapp20 constant definitions to top-level build file. (dotnet/corefx#31470)
* 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
2018-08-29 08:49:33 -07:00
Tomas Weinfurt 70298e83c9 add back parsing for simple configuration (dotnet/corefx#31314)
* add back simplified proxy configuration
* add tracing
* feedback from review


Commit migrated from https://github.com/dotnet/corefx/commit/2c5f29064929d4f1c60be7c5c301a488dfab02c4
2018-07-24 11:10:18 -07:00
Tomas Weinfurt 4530e104dd improve port parsing to be more resilient against trailing characters (dotnet/corefx#31232)
improve port parsing to be more resilient against trailing characters


Commit migrated from https://github.com/dotnet/corefx/commit/56d177d8ed94096c13ac14894945899783b1a3df
2018-07-21 16:59:37 -07:00
Eric Erhardt 779486884e Merge master into SdkProj
Commit migrated from https://github.com/dotnet/corefx/commit/ec546de620c5248f3662d6aaca989ed382b86b6b
2018-06-28 21:28:41 -05:00
Eric Erhardt 8b6d5baf20 Change .csproj to new Configurations property
Change .sln to use the managed C# project system GUID.


Commit migrated from https://github.com/dotnet/corefx/commit/e05508a62d28f4807f85abe9cb7adf8382f792b4
2018-06-28 17:49:22 -05:00
Stephen Toub 4c9eb2ec25 Simplify built-in types across corefx tests (dotnet/corefx#30660)
Commit migrated from https://github.com/dotnet/corefx/commit/7ae1a252d7e68c5513d2658de7a401c37e9b0504
2018-06-25 22:42:04 -07:00
Stephen Toub d8cf8e0a06 Fix CacheControlHeaderValue's rendering of negative values (dotnet/corefx#30554)
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
2018-06-20 12:51:11 -04:00
Eric Erhardt 70091b9c8b Merge master into SdkProj
Commit migrated from https://github.com/dotnet/corefx/commit/ad505eb98c6a887db2d2932fec256d9e4e394169
2018-06-11 17:20:10 -05:00
Stephen A. Imhoff fb1798288f Consolidate http date parsing (dotnet/corefx#28843)
* 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
2018-05-24 10:39:16 -04:00
wtgodbe f38ceb30be Convert all .csproj files in src to SDK-style projects
Commit migrated from https://github.com/dotnet/corefx/commit/91d7e62bbf28094a2b419b87847bcd6a7658564d
2018-05-21 11:53:46 -07:00
Stephen Toub f3656cb566 Use shared StringBuilderCache (dotnet/corefx#29657)
Commit migrated from https://github.com/dotnet/corefx/commit/03df812785e99885efde06a0f88d82578955276e
2018-05-11 17:39:06 -04:00
David Shulman 264474f8a3 Removed duplicated type HttpVersionInternal (dotnet/corefx#29545)
Removed duplicated type HttpVersionInternal

We added HttpVersionInternal back when it differed from the System.Net.Primitives HttpVersion type. But now that the two types are the same, we can remove the duplicated internal type.

Fixes dotnet/corefx#26492


Commit migrated from https://github.com/dotnet/corefx/commit/40faa4ed5c699e84afbb78f6ff96feb7b99db320
2018-05-07 14:00:19 -07:00
Marco Rossignoli 528e91dabf Replace identical files with CoreLib mirror (dotnet/corefx#28593)
Commit migrated from https://github.com/dotnet/corefx/commit/5041dbb272ae05b360db538cf62fc2847277fd7e
2018-04-17 16:05:44 -07:00
Max Kerr 6d31e9d045 Improve parsing of WinINet default proxy strings in SocketsHttpHandler (dotnet/corefx#28671)
This is a partial fix for dotnet/corefx#28603.

Commit migrated from https://github.com/dotnet/corefx/commit/22e88da0b430d16def339e52891acf0e0563dbf6
2018-04-04 11:26:29 -07:00
Tomas Weinfurt ff137b9fba add proxy bypass list processing for windows (dotnet/corefx#28210)
* 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
2018-04-02 13:45:51 -07:00
Tomas Weinfurt bcf90e9e92 improve handling of proxy environmental variables (dotnet/corefx#28088)
* improve handling of proxy environmental variables
* feedback from reviews
* update port parsing
* use Span instead of Substring to parse port
* fix more feedback


Commit migrated from https://github.com/dotnet/corefx/commit/d5ecebef316f2be53a25894d8f1b4c6b91698e36
2018-03-27 13:48:19 -07:00
David Shulman 1e1b3a1e05 Fix WinHttpHandler error handling (dotnet/corefx#28367)
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'."

Closes dotnet/corefx#28156
Contributes to dotnet/corefx#26278


Commit migrated from https://github.com/dotnet/corefx/commit/ce4ebdfbf2080a38855ab8df5c9bb553db8724af
2018-03-22 12:58:54 -07:00
Geoff Kizer 64ea71c544 add ntlm auth and proxy auth for tunnel, and rework auth handling generally
Commit migrated from https://github.com/dotnet/corefx/commit/5d209e6e6280ced6c3ef4afda57c6f486ae36118
2018-02-28 02:57:05 -08:00
Lakshmi Priya Sekar 548687e68b Merge pull request dotnet/corefx#26979 from Priya91/newhttpauth
Add test infra for auth testing.

Commit migrated from https://github.com/dotnet/corefx/commit/ff123e89989b2b34e82c854ea597626d884d52ba
2018-02-20 11:06:08 -08:00
Stephen Toub 51b78a974c Implement SocketsHttpHandler's Expect100ContinueTimeout and ConnectTimeout (dotnet/corefx#27242)
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
2018-02-19 11:06:18 -05:00
Lakshmi Priya Sekar e9414ba693 Add test infra for auth testing.
Commit migrated from https://github.com/dotnet/corefx/commit/a7d6718d2919ef81a5cebb0ce92a53b4989234d4
2018-02-14 15:52:23 -08:00
Tomas Weinfurt 844d6893d1 minimal support for ManagedHandler proxy configuration on Windows (dotnet/corefx#26878)
* initial implementation 

Commit migrated from https://github.com/dotnet/corefx/commit/468db63e2648f8a4c0c82d97e301e308b7887f7e
2018-02-09 12:05:30 -08:00
Stephen Toub 89dfde815e Expose SocketsHttpHandler
- 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
2018-02-08 19:12:50 -05:00
Tomas Weinfurt ba0964d681 add proxy configuration based on environment variables on Unix (dotnet/corefx#26341)
* 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
2018-01-31 15:46:27 -08:00
Tomas Weinfurt 8492f6e784 merge positive and negative test to one. add more test cases
Commit migrated from https://github.com/dotnet/corefx/commit/6457d8102bc6527b8a5277c7cc4838a497cf2e48
2018-01-29 17:14:05 -08:00
Tomas Weinfurt 3af560535e update from reviews. refactor opaque handling, make realm mandatory and add negative test case.
Commit migrated from https://github.com/dotnet/corefx/commit/dd1d93fc8a25343ab15360e368a0c7d900355c34
2018-01-29 16:26:52 -08:00
Tomas Weinfurt bbfbb9779f make opaque parameter optional
Commit migrated from https://github.com/dotnet/corefx/commit/a623ebc34fd63d85b65af7ed91a967d37cf1d906
2018-01-28 22:43:47 -08:00
Lakshmi Priya Sekar 3fed718665 Remove unsafe parsing code from DigestResponse.
Commit migrated from https://github.com/dotnet/corefx/commit/9baef43e0b65f0d4da06122fd0c5dfcf56cc2384
2018-01-18 13:49:37 -08:00
Stephen Toub defc370985 Remove netfx config from System.Net.Http.Unit.Tests
Commit migrated from https://github.com/dotnet/corefx/commit/91ec984d64908b3ab312bef6f6fa599f5ea1cee7
2017-10-09 14:52:33 -04:00
Geoff Kizer 32beab592f several HeaderDescriptor-related improvements
Commit migrated from https://github.com/dotnet/corefx/commit/3d04b0f3cd6bd94d4677babcc9404bf1937d6b63
2017-08-12 23:24:50 -07:00
Geoff Kizer 5dd1f13e5d address review feedback
Commit migrated from https://github.com/dotnet/corefx/commit/0412383441c9e73d1d4564e4f6a4095c8531ff48
2017-08-09 21:46:32 -07:00
Geoff Kizer 81b0f8e756 add HeaderDescriptor and use as key for header store
Commit migrated from https://github.com/dotnet/corefx/commit/b963747c6ef3df6a9512854714fcb11b38f1c0c8
2017-08-09 16:49:36 -07:00
Stephen Toub b8b0144608 Clean up usage of UriHelper (dotnet/corefx#22888)
* Delete dead UriHelper from System.Net.Http

* Replace UriHelper usage with Uri usage

Also clean up IsHexDigit/FromHex to be more streamlined.


Commit migrated from https://github.com/dotnet/corefx/commit/8b4fd5fccf19c2e342ddc3eb25f62507f300c778
2017-08-02 20:21:57 -04:00
Stephen Toub 2177f832b6 Remove UriShim from HttpClient (dotnet/corefx#22873)
- Uri's members are now back in core; it can just use those directly.
- Rather than calling HexEscape per character, which allocates a string per character, we can just encode directly to the StringBuilder.

Commit migrated from https://github.com/dotnet/corefx/commit/172f077c7875f12aa170a68f7ca62655e298badf
2017-08-02 16:44:02 -04:00
Stephen Toub 02c844fe4c Remove ManagedHandler files from UnitTests
No need for them to be there.


Commit migrated from https://github.com/dotnet/corefx/commit/76b8639ba439b7b3287c97d3cd1956948c0832f4
2017-07-20 08:01:07 -04:00
Stephen Toub 5f18995584 Improve connection pooling in ManagedHandler
Add support for purging stale connections from the pool and for a max number of connections per server.


Commit migrated from https://github.com/dotnet/corefx/commit/b52ad56a22e4bfabb55adc166396e1221b0e75f6
2017-07-19 23:28:54 -04:00
Hugh Bellamy 98b18432b7 Move AssertExtensions to Corefx.Private.TestUtilities (dotnet/corefx#21799)
* Move AssertExtensions to Corefx.Private.TestUtilities

* Update csprojs

* Fix Linq.Expressions uapaot build


Commit migrated from https://github.com/dotnet/corefx/commit/7e3b0db2892c56a431f8e99af9cd9381adec385a
2017-07-03 09:27:30 -07:00
Stephen Toub 2a44f0736d Clean up ManagedHandler class a bit
- 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
2017-06-26 23:01:42 -04:00
Stephen Toub 9ed67baf58 Replace some hardcoded strings in the implementation
Commit migrated from https://github.com/dotnet/corefx/commit/054c6ab6895ccce97e0e9d980503fa12d0d21594
2017-06-26 23:01:42 -04:00
Hugh Bellamy 7cbcd5ed85 Convert most Assert.Throws<ArgumentException> without param name to AssertExtensions (dotnet/corefx#21455)
* Registry

* Collections

* ComponentModel

* Configuration

* Data

* Globalization

* Drawing

* Diagnostics

* IO

* Linq

* Add System.Net param names in tests

* Move ArgumentExceptions in System.Private.Xml to AssertExtensions

* Add System.Reflection.* ArgumentException param names

* Add param names for System.Runtime* ArgumentExceptions

* Add ArgumentException param names to System.Security.*

* Add ArgumentException param names to System.Text.*

* Add param names to ArgumentExceptions in misc projects

* Add System.Threading.* ArgumentException param names

* Fix missing files

* Fixes for unix and netfx

* Fix more failures and revert a IdnaConformance tests to avoid merge conflicts with dotnet/corefx#21463


Commit migrated from https://github.com/dotnet/corefx/commit/59915687bb261efeae70565d0ca8990ac45ceb9c
2017-06-23 12:33:47 -07:00
Stephen Toub 1de0cf31b0 Integrate ManagedHandler into Windows and Unix builds
- 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
2017-06-22 09:26:46 -04:00
Geoff Kizer 1e97b3d02d Initial prototype of managed HttpClientHandler
Commit migrated from https://github.com/dotnet/corefx/commit/0893c2a886f4cef21697a570a26819b0c7640f9c
2017-06-22 09:26:46 -04:00
Eric St. John 67a1a83adf Update configurations
Commit migrated from https://github.com/dotnet/corefx/commit/a152026c63c03dda2e470b780ecb4b3aa9671e11
2017-05-19 10:17:08 -07:00
David Shulman 5ca9996b44 Fix Http Unit Tests
Fixed the System.Net.Http Unit Tests so that they build and run properly
for uap and uap-aot scenarios.

Removed the ICloneable.cs file which is no longer needed now that master
branch has ICloneable support in it.


Commit migrated from https://github.com/dotnet/corefx/commit/443f58923e1c2263cd81efce751123a21935febc
2017-05-18 13:48:48 -07:00
Marek Safar df19e1fb58 Fixes NRE when setting Size property of ContentDispositionHeaderValue
Commit migrated from https://github.com/dotnet/corefx/commit/d6a3dbe4addaae897b9d82aedb3afeb125740f29
2017-04-05 18:56:39 +02:00
Santiago Fernandez Madero de36b4d76e Update csproj and solutions configurations (dotnet/corefx#17613)
* Update csproj and solutions configurations


Commit migrated from https://github.com/dotnet/corefx/commit/9fa0bc5de96946eb3e109f13768f1258cfaddc73
2017-03-28 14:36:26 -07:00
David Shulman 67cf9310ba Fix Http Unit tests for NETFX build
Change the CSPROJ so that Http Unit tests now build and run
successfully.

i.e.:

>Msbuild /t:rebuildandtest /p:TargetGroup=netfx

now works in the src/System.Net.Http/tests/UnitTests folder


Commit migrated from https://github.com/dotnet/corefx/commit/06e9ab3021a00e8fe092a0abd6476296fcd12989
2017-03-27 13:08:08 -07:00
Stephen Toub 83f241c5c2 Audit all corefx Streams with Read/WriteAsync overrides (dotnet/corefx#16134)
* Audit all corefx Streams with Read/WriteAsync overrides

Any that have overrides of these that do something real (e.g. not just throw) also need overrides of Begin/EndRead/Write.


Commit migrated from https://github.com/dotnet/corefx/commit/e9ecf74d845476540f40fa8fdc62c53ebf048519
2017-02-14 17:03:16 -08:00
Tarek Mahmoud Sayed addda8630e Enable tests to compile with netstandard (dotnet/corefx#15956)
* 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
2017-02-08 15:32:53 -08:00
Tarek Mahmoud Sayed 77cad86b1e Remove versioned configuration from test projects (dotnet/corefx#15879)
The changes onclude some other minor clean up in the test project files

Commit migrated from https://github.com/dotnet/corefx/commit/62212cca900081173fce70991c3a0b30393994a3
2017-02-06 13:52:11 -08:00