Commit Graph
172 Commits
Author SHA1 Message Date
stephentoub 025ea3f97f Update packages to rc3-23931-00
Commit migrated from https://github.com/dotnet/corefx/commit/e421dd9c41c308f83511e350c1e407d1f728ba78
2016-03-31 08:26:49 -04:00
Stephen Toub c7897db0b5 Merge pull request dotnet/corefx#7337 from stephentoub/httpclient_tests
Add more tests for HttpClient

Commit migrated from https://github.com/dotnet/corefx/commit/fc0919e2471a8b99958245dcfd23f79481c02bd9
2016-03-30 15:47:09 -04:00
stephentoub 99e0ca33de Address PR feedback
Switch to avoid network requests when possible, and bring line coverage up to 100%.


Commit migrated from https://github.com/dotnet/corefx/commit/71e246929f5ae99bbba8611b7a5239a041b94f42
2016-03-30 08:18:40 -04:00
stephentoub dabfe7fc9d Update packages to rc3-23930-00
Commit migrated from https://github.com/dotnet/corefx/commit/64a2b6c70977e33b4e8fb90e8f5d3b019b843e61
2016-03-30 07:30:59 -04:00
stephentoub a4d7a22225 Add more tests for HttpClient
To have more confidence while refactoring, added more HttpClient coverage, in particular of error paths.  Brings HttpClient line coverage from 64.7% to 98.3%, and branch coverage from 42.3% to 78.7%.


Commit migrated from https://github.com/dotnet/corefx/commit/2b88030aa1d2e7cb0b679e871fc4d0613ebbbf02
2016-03-29 19:34:21 -04:00
stephentoub d156fea268 Remove unnecessary string allocations in MultipartContent
More low-hanging fruit.  When building up its output, MultipartContent is already using a StringBuilder, but it's creating temporary intermediate strings which it then writes to the StringBuilder, rather than just adding the constituent pieces to the StringBuilder directly.  And when computing the length of the output, it's again generating lots of intermediate strings, when it could instead just measure the size of each of the constituent pieces.


Commit migrated from https://github.com/dotnet/corefx/commit/47e9bbeab66b38b21e512243b5ed16590156d35b
2016-03-27 22:24:26 -04:00
stephentoub 753c12bd76 Ensure CurlHandler sets CBT even on fast verification path
When we get called back by libcurl to verify the server's certificate, we try to take a fast path where we use OpenSSL's certificate verification rather than doing our own, which is more comprehensive but also slower.  However, when we added that fast path, we inadvertently ended up not setting the Channel Binding Token in that case, only doing so in the fallback path.  This fixes that, moving the configuring of the CBT up to before we ask OpenSSL to verify the cert.


Commit migrated from https://github.com/dotnet/corefx/commit/bb26ba8b5375e76d00db8b371abb6e273e7b4019
2016-03-26 22:36:02 -04:00
stephentoub aa64955b41 Update packages to rc3-23925-00
Commit migrated from https://github.com/dotnet/corefx/commit/268eea1b538fa80a0042a1eabc4e51c84473d7b0
2016-03-25 20:23:47 -04:00
stephentoub 11bb3f3c94 Remove and replace some stale [ActiveIssue(...)]
Remove some stale [ActiveIssues] where the tests now pass.

Replace some others with [PlatformSpecific], where the behavior is deemed to be "by design" / accepted.

And update a few issue numbers.


Commit migrated from https://github.com/dotnet/corefx/commit/9c13b0c9389189d86fb2d270c28660946b3ae80c
2016-03-25 15:24:49 -04:00
stephentoub 57672b1925 Add assert for status code to cookies test
This test failed once, and I expect it was just due to a network blip that caused the request to fail, but since we're not currently checking the http status code, I can't be sure.  As such, I'm just adding another assert for the expected status code, and if this repros again, we'll know whether that's the issue.


Commit migrated from https://github.com/dotnet/corefx/commit/50b2ce5699eb7034a033b3d125ad62bf03b23458
2016-03-24 19:07:44 -04:00
stephentoub e91101e062 Add tests for certificate revocation and non-OpenSSL backend
Commit migrated from https://github.com/dotnet/corefx/commit/9d4347b5bdca817937dea602f452df3fc2e9e2f3
2016-03-23 16:42:05 -04:00
stephentoub e9e2575810 Change http shim to support getting better version info
Currently the shim exposes a single method to get just the information that was needed when this was written.  Every time we need to get additional version info, we need to change the existing signature (which won't version well) or add additional similar signatures (will which be confusing).  Instead, I've changed it to have more fine-grained entrypoints, each exposing a particular piece of info.  We may end up making a few more interop calls on first-use, but the overhead is negligable.

With that scheme, I've then exposed additional entrypoints for getting version information, in order to provide better tracing and exception error messages.

This is then also used in tests to only run tests when certain features are available.


Commit migrated from https://github.com/dotnet/corefx/commit/29b0dc7b810776178bf42851064c397e47c4d0b8
2016-03-23 14:10:36 -04:00
stephentoub 436bbdf105 Add HttpClientHandler tests for server certificates
Commit migrated from https://github.com/dotnet/corefx/commit/65a4486bfe44c633c2e4dad6dabc6688bea16cc2
2016-03-23 14:10:19 -04:00
stephentoub 0de8ee2b33 Update packages to rc3-23923
Commit migrated from https://github.com/dotnet/corefx/commit/123180cde4aadbed151ffbc00c09b85b7532da68
2016-03-23 11:56:57 -04:00
stephentoub b60997fa74 Update packages to rc3-23921
Commit migrated from https://github.com/dotnet/corefx/commit/3eb508d41d476e4ca0c74d106584c7a7f0d51a17
2016-03-21 12:10:10 -04:00
Jon Hanna 1c58a2a42a Fix multiple typos [5]
Commit migrated from https://github.com/dotnet/corefx/commit/00a0871c5cc4ff6af7f036946eef48644ed1e27d
2016-03-20 19:15:44 +00:00
Eric St. John 6aeccb0bae Fix tests to restore using the latest packages
We removed the lifting from the lineup so tests should reference the
latest packages in order to ensure an implementation is available.

The latest pacakges exclude implementation dependencies so I needed to
add these to projects that were depending on them coming in transitively.


Commit migrated from https://github.com/dotnet/corefx/commit/bef9061fd1238adf47b864d8924d121e4134465b
2016-03-19 08:01:11 -07:00
Eric St. John ff75367f93 Update packages to rc3-23918
Commit migrated from https://github.com/dotnet/corefx/commit/d3d217b2ab336b862c27a3e605e32dc0c0a6d472
2016-03-19 08:01:09 -07:00
Kevin Jones c428584581 Fix typo in file name.
Commit migrated from https://github.com/dotnet/corefx/commit/af8c01f507c9227a8a11fb752c7df2142f7b4044
2016-03-18 12:45:24 -04:00
stephentoub 1cbe15bf38 Query for the right proxy creds in HttpClient
Both the WinHttp and libcurl implementations are using the target Uri to lookup the right proxy credentials rather than using the proxy's Uri.


Commit migrated from https://github.com/dotnet/corefx/commit/d0cc5116a9906834f5ebd1813c9b9eed68ea054b
2016-03-17 10:34:06 -04:00
Justin Van Patten 34d430921b HttpClient: Add comment to Set-Cookie test
Add a comment explaining the header value lengths being tested.


Commit migrated from https://github.com/dotnet/corefx/commit/2664968783439ddc3b64b99e0d42d1d293e1a082
2016-03-12 09:07:03 -08:00
David Shulman a576f9d8e1 Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/ad0aa0c7f912a39275c955062e805d8853993f31
2016-03-11 07:07:20 -08:00
David Shulman 420449a472 Fix WinHttpHandler when no proxy creds after 407 response
We were getting an assert if we had an authenticating proxy but didn't have any credentials to send. After the initial 407 was received from the proxy, we then tried to set credentials for a retry. But since we didn't have any, we triggered an assert in SetWinHttpCredential.

The fix is to check for null credentials after getting the 407 response. If there are no credentials, then we end the retry loop with the final 407 status code.


Commit migrated from https://github.com/dotnet/corefx/commit/89966ef37a1269471069c2ee14cdb6af51d8a707
2016-03-10 19:18:38 -08:00
Stephen Toub 4374bc6d33 Merge pull request dotnet/corefx#6799 from stephentoub/strip_content_headers
Remove content headers in CurlHandler when automatically decompressed

Commit migrated from https://github.com/dotnet/corefx/commit/1ca11068f411628cce053d9ef0295b80e7135d90
2016-03-10 14:54:54 -05:00
stephentoub d5e591e45a Update packages to rc3-23910
Commit migrated from https://github.com/dotnet/corefx/commit/ab3948bfab039aac2afc1b521883425a171b982d
2016-03-10 09:37:40 -05:00
stephentoub edeb083709 Remove content headers in CurlHandler when encoded
WinHttpHandler removes the Content-Length and Content-Encoding headers when the content was automatically decompressed.  Do the same in CurlHandler.


Commit migrated from https://github.com/dotnet/corefx/commit/093dafe74d53c2222ff6f434107d49205cf7fa2f
2016-03-10 08:14:59 -05:00
Justin Van Patten 0d18ce8a1d HttpClient should not miss Set-Cookie response headers
Recent changes due to PR dotnet/corefx#3199 caused `HttpClient` on Windows to miss
`Set-Cookie` response headers when one of the header values was large
enough to cause `WinHttpQueryHeaders` to fail with
`ERROR_INSUFFICIENT_BUFFER` and advance the index.

This commit addresses the regression, by always setting the index
back to the index we want to retrieve.

Added a new test to validate this change.

Fixes dotnet/corefx#6737.


Commit migrated from https://github.com/dotnet/corefx/commit/f7e9f00aba800d2ea63e040deafcc7ee220331fc
2016-03-09 02:35:42 -08:00
Eric St. John 8cba463a08 Update crypto package dependency versions
System.Security.Cryptography.Algorithms, Cng, and X509Certificates are
now 4.1.0.  Update dependencies to ensure we get the right build.


Commit migrated from https://github.com/dotnet/corefx/commit/6e3e29dbec3705094a539b6b2dc863c5a8ee270c
2016-03-08 21:40:47 -08:00
Eric St. John 04a73fbed6 Update packages to rc3-23908
Commit migrated from https://github.com/dotnet/corefx/commit/86a230845c4f1840dcb9b52165c6976fad5b5868
2016-03-08 08:46:50 -08:00
Stephen Toub ab2ef9d0fd Merge pull request dotnet/corefx#6727 from davidsh/blank_statusdescription
HttpResponseMessage.ReasonPhrase should not be null

Commit migrated from https://github.com/dotnet/corefx/commit/3da7a023a2cf89c0a980a6c5cde25b67be530f68
2016-03-07 20:40:09 -05:00
David Shulman 1e120fdd63 HttpResponseMessage.ReasonPhrase should not be null
Recent changes due to PR dotnet/corefx#3199 caused the `HttpResponseMessage.ReasonPhrase` property to be a null string if the HTTP server response only contained a statuscode but no description on the status line. The existing .NET Framwork behavior is to have empty string as the property value in that case.

Added a new test to validate this change.

Fixes dotnet/corefx#6721.


Commit migrated from https://github.com/dotnet/corefx/commit/19ec320403cd53ad0cba75c69a1a2c027ed867d5
2016-03-07 12:23:04 -08:00
stephentoub 38f7d19954 Update packages to rc3-23907
Commit migrated from https://github.com/dotnet/corefx/commit/baed539ebb753fefc91da9870ddeee72df0a6e14
2016-03-07 10:12:40 -05:00
stephentoub f6386c1530 Disable SSLv2 and SSLv3 in CurlHandler
Commit migrated from https://github.com/dotnet/corefx/commit/2ec7d66814f0f2a789356590962d5198c9745912
2016-03-04 17:02:27 -05:00
stephentoub f3434408bc Update xunit.netcore.extensions to 00187
Commit migrated from https://github.com/dotnet/corefx/commit/3cfd81e7369628d052da6367b28c6f5b5839f55d
2016-03-03 22:06:40 -05:00
stephentoub 579dd2cba9 Address more PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/15b2483a8d1ce5d495f75588ec2f1c0e3ae5bb2b
2016-03-03 12:21:10 -05:00
stephentoub b4708c3018 Add additional tests for IsBypassed and DefaultCredentials
And fixed a few other nits of feedback.


Commit migrated from https://github.com/dotnet/corefx/commit/bbef5f03fdbdf276851d82ce2c189b4ea1a4a826
2016-03-03 11:31:33 -05:00
stephentoub 6154fe40a2 Add HttpClientHandler test for proxies
We don't currently have any functional tests in the repo for using HTTP proxies.  This commit adds a very simple loopback GET request proxy server, just enough to verify that HttpClient does go through the specified proxy and pass credentials if requested.  If/when we get better infrastructure in place for this kind of thing, we can remove the proxy implementation and replace the test, but for now, this at least provides some automated verification cross-platform.


Commit migrated from https://github.com/dotnet/corefx/commit/db2d84b0bb4032ca21b8e7c9cfd96056ffddbab2
2016-03-03 08:23:57 -05:00
stephentoub 9b4473ede7 Upgrade package versions to rc3-23901
Commit migrated from https://github.com/dotnet/corefx/commit/55246a7fc60807d021fded5e333784956a662a51
2016-03-02 07:40:12 -05:00
Pallavi Taneja 38e2f4de64 Update the packages
Commit migrated from https://github.com/dotnet/corefx/commit/be7151b45a54577c2e28c56977408d7d61ed0ea9
2016-02-29 13:09:16 -08:00
Justin Van Patten fb984b77d4 Reduce CurlHandler header parse allocations
Use existing known header and reason phrase instances instead of
always allocating new strings and avoid unnecessary intermediate
string allocations.


Commit migrated from https://github.com/dotnet/corefx/commit/8aab95829d92185966ec9b79702101a2f167cd49
2016-02-25 10:41:05 -08:00
David Shulman 19962646b8 Response stream reads should return error for insufficient data
WinHttpResponseStream was not tracking the amount of data read when the response used 'Content-Length' semantics. So, if the amount of bytes read from the server was less than expected, we did not return an error. This was different behavior than .NET Framework.

Fixed WinHttpResponseStream so that it will track the total number of bytes read and compare it to the expected number of bytes if using 'Content-Length' semantics. Note that we don't do this checking if the HTTP request is a HEAD request. That is because the definition of that HTTP verb is to return headers "as-if" it was returning a real response body. So, the 'Content-Length' might be set but there is no response body for a HEAD request.

For cases of using 'Transfer-Encoding: chunked' semantics for the response body, there is already error checking at the lower HTTP layer in WinHTTP.

Fixes dotnet/corefx#6231.


Commit migrated from https://github.com/dotnet/corefx/commit/7f5d6b643996306062836a17ddad643fd7e40ff2
2016-02-21 15:36:38 -08:00
David Shulman 3c429d38af Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/e1847ee878dcd48ce66f330761f50a96e7e9b2b0
2016-02-20 20:32:45 -08:00
David Shulman 1127bdc413 Add more Http response stream tests
Building on PR dotnet/corefx#6250, added more response stream tests dealing with
invalid response body transfer semantics.


Commit migrated from https://github.com/dotnet/corefx/commit/42e5f468e86f7d62fe1c62194bfd473d30cf06b7
2016-02-20 19:21:10 -08:00
stephentoub 951b06b86c Add test for invalid response content length
Commit migrated from https://github.com/dotnet/corefx/commit/f9d488485d2bb7edeb43f918af1746d9ecb5e758
2016-02-19 17:32:27 -05:00
Stephen Toub 26c1962d0d Merge pull request dotnet/corefx#6209 from stephentoub/nameof_exceptions
Deploy nameof throughout corefx

Commit migrated from https://github.com/dotnet/corefx/commit/1bd332f2e5f559c2eab276acb0d9e4256085ec2f
2016-02-19 14:10:39 -05:00
stephentoub 7385fb7563 Fix two build warnings
Commit migrated from https://github.com/dotnet/corefx/commit/499960b0345be841d0eb5bd174d68045a2c8d5f0
2016-02-19 10:42:25 -05:00
dotnet-bot b32ddb5d98 Deploy nameof throughout corefx in MemberData
Commit migrated from https://github.com/dotnet/corefx/commit/9c3156b9ada06b8e58ac53d48fc303500bf3e476
2016-02-18 23:58:15 -05:00
David Shulman 52476494de Merge pull request dotnet/corefx#3199 from justinvp/winhttphandler_parseresponseheaders
Reduce allocations when parsing response headers in WinHttpHandler

Commit migrated from https://github.com/dotnet/corefx/commit/35f7ef05a8022358ec435152e7099d8263a4422a
2016-02-18 15:52:45 -08:00
stephentoub 95d7cc7534 Update packages to rc3-23818
Commit migrated from https://github.com/dotnet/corefx/commit/380a2ebf4a498f9ab0a819c71d8717377e601bfb
2016-02-18 07:28:09 -05:00
Justin Van Patten 8e6b8806d3 Reduce response message allocations in WinHttpHandler
Reduce allocations associated with interop calls to
WinHttpQueryHeaders and parsing response headers.


Commit migrated from https://github.com/dotnet/corefx/commit/ce63f30fcc11eca57b13753effbb057ce6547688
2016-02-16 18:47:54 -08:00