Commit Graph
1390 Commits
Author SHA1 Message Date
Tom Deseyn eaea0196f2 Update tests for xplat differences.
Commit migrated from https://github.com/dotnet/corefx/commit/8d7cb8426886f4318ae98db571a52f9dab5efa10
2017-11-21 11:53:02 +01:00
Tom Deseyn f310758fc2 Fix test
Commit migrated from https://github.com/dotnet/corefx/commit/33622488472c61216fb3ca0851b30be658b85146
2017-11-20 14:46:11 +01:00
Tom Deseyn 9610a54b33 Clean-up test
Commit migrated from https://github.com/dotnet/corefx/commit/37b203a968f57ca4925795971bef9993926a86b2
2017-11-20 14:31:16 +01:00
Tom Deseyn 6d00842c13 Add test
Commit migrated from https://github.com/dotnet/corefx/commit/24f3d4d7096a54d46bdc1969475b55c01d04dce5
2017-11-20 14:26:57 +01:00
Tom Deseyn 7515cacb4e Make curl http handler use SSL_CERT_FILE/SSL_CERT_DIR environment variables.
Commit migrated from https://github.com/dotnet/corefx/commit/2e3f4d5ce9a138423e6f93a736da0e077ff8c3de
2017-11-13 14:38:18 +01:00
David Shulman 19ef688da1 Cleanup Windows 10 version detection (dotnet/corefx#25052)
* Cleanup Windows 10 version detection

Windows 10 Version 1709 ("Fall Creators Update") has been released. This
PR cleans up the version detection to use the latest RTM build numbers
and removes obsolete InsiderPreview detection for those tests.

Also, removed ActiveIssue for tests that are now fixed due to Windows 10
fixes.

Fixes dotnet/corefx#22187

* Addressed feedback


Commit migrated from https://github.com/dotnet/corefx/commit/ac410223aa763a0f67880815057ee1bfe0f4cb6e
2017-11-04 11:09:38 -07:00
Krzysztof Wicher f3f741eade Use distro detection from Microsoft.DotNet.PlatformAbstractions (dotnet/corefx#24531)
Commit migrated from https://github.com/dotnet/corefx/commit/4bf90198c5e7710ea67b7c1b467e859ec8bb78e5
2017-11-03 14:30:47 -07:00
Stephen Toub 54c1d578d8 Mark applicable structs as readonly
Commit migrated from https://github.com/dotnet/corefx/commit/54e889a7c71bf22f9f1ef244a9d040fee64c74d5
2017-11-03 09:48:47 -04:00
Stephen Toub dfced62bc2 Add ManagedHandler support for cancelling connect operations (dotnet/corefx#24873)
Commit migrated from https://github.com/dotnet/corefx/commit/0e517d15d2a90aceffdd6bbc6c1de80b8582a154
2017-10-30 15:02:27 -04:00
Stephen Toub 087ef535f4 Use the Host header for the SSL handshake
Commit migrated from https://github.com/dotnet/corefx/commit/5ecea8ff47c03a073a77916a9c7d1d806f8c7ce3
2017-10-25 13:40:03 -04:00
Stephen Toub ac386deda7 Don't fail a redirect that's missing a Location header
Commit migrated from https://github.com/dotnet/corefx/commit/ddfab940fcc2d571c2da85250c13e457ab1933a2
2017-10-25 13:23:59 -04:00
Stephen Toub 3fc43905bc Fix DecompressionHandler ContentEncoding logic
Not clear what it's currently trying to do.  It should be simple.


Commit migrated from https://github.com/dotnet/corefx/commit/3c17c2251b4bda98273e57ef153cc9bc267805c8
2017-10-25 13:23:58 -04:00
Stephen Toub 06fe2c8c64 Reorder cookie handling in handler chain
It should come lower in the stack than proxy or credentials so that any responses that trigger re-requests and that have Set-Cookie headers are appropriately processed.


Commit migrated from https://github.com/dotnet/corefx/commit/8b5dced9d6b8df49c6dfa49af8015bd47f9a811d
2017-10-25 13:18:30 -04:00
Stephen Toub 5a9bb53af7 Make Expect: 100-continue handling more robust (dotnet/corefx#24789)
When libcurl sends an Expect: 100-continue header, if it gets back a success error code, it may avoid sending the remaining payload and also may keep the connection open, which can confuse servers that expect to receive the fully promised payload and that don't close the connection when sending a final success status code instead of 100 continue.  To mitigate this, we simply change the default ExpectContinue == null behavior to be the equivalent of ExpectContinue == false rather than to be "do whatever the platform decides".  This also more closely aligns with WinHttpHandler and ManagedHandler, where effectively the "platform" in those cases decides that the default is disabled.

For ManagedHandler, currently we're mimicking behavior like that libcurl employed and may sometimes not send the full payload but still keep the connection open.  Instead, make sure we either always send the full payload or close the connection.

Commit migrated from https://github.com/dotnet/corefx/commit/724ddb8fc95a5b1f639cfa508a32b9a8c50c1949
2017-10-23 12:29:26 -04:00
Stano Peťko 4d0dc88ac3 Remove dead code from System.Net.Http (dotnet/corefx#24735)
* Deleted dead code from System.Net.Http.

* Returned back strings, used in other platforms.

* Returned back string net_http_value_not_supported.

* Deleted dead code from System.Net.Http.

* Returned back strings, used in other platforms.

* Returned back string net_http_value_not_supported.


Commit migrated from https://github.com/dotnet/corefx/commit/cdc2a7a7c27ccfcf061913c8df6f9000ffdd919b
2017-10-19 23:37:31 -04:00
Lakshmi Priya Sekar bf6b1cf702 Merge pull request dotnet/corefx#24389 from Priya91/tlsextension
Add ALPN support for SslStream.

Commit migrated from https://github.com/dotnet/corefx/commit/57b4664ba0a022de3a846b436a3a3a6bf7b91ead
2017-10-19 11:08:08 -07:00
Stephen Toub 6d13fd5bc3 Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/3b9525bd44ffab17a227cad47ae607bbf370dc1c
2017-10-18 00:19:35 -04:00
Geoff Kizer 3333dfede4 add more cases and make tests more robust
Commit migrated from https://github.com/dotnet/corefx/commit/a3cab9a48cc373eaf45a513d9c60895446c9bafc
2017-10-17 11:49:00 -04:00
Geoff Kizer cf5033763d add some basic protocol tests for status line handling
Commit migrated from https://github.com/dotnet/corefx/commit/79709c46a1e84ccae519ca58a12f9f29f0b64db5
2017-10-17 11:49:00 -04: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
Stephen Toub c6edd8d7ce Update System.Net.Http to use Memory-based Stream methods
- Overrides Read/WriteAsync(Memory, ...) on streams
- Updates calls where relevant to use ReadAsync(Memory, ...) to avoid task allocation when possible


Commit migrated from https://github.com/dotnet/corefx/commit/cc4cb743671f2973c7c5a9bd39d7d4f8b525b979
2017-10-09 12:19:28 -04:00
Lakshmi Priya Sekar be2f44d05f Add alpn support on Linux.
Commit migrated from https://github.com/dotnet/corefx/commit/14f807c16a32ed4331fbd52ec2af1cdcfe0ce987
2017-10-06 15:01:09 -07:00
David Shulman 44f7f6d8e2 Removed obsolete System.Net.Http NETFX related files (dotnet/corefx#24453)
Due to PR dotnet/corefx#23611, the master branch no longer builds a NETFX binary for
System.Net.Http. Instead this is now handled only in the release/2.0.0
branch as part of the "NETStandard support package".

This effectively means that we have already stopped OOB'ing
System.Net.Http on .NET Framework platforms as of .NET 4.7.1 since that
version of .NET Framework supports all NETStandard2.0 APIs.  And .NET
Framework versions prior to that (4.6.x, etc.) are handled with the OOB
System.Net.Http.dll that is part of the NETStandard support package.

Commit migrated from https://github.com/dotnet/corefx/commit/a6b0655b1537044d85e97a69ef80bfd661e25ca5
2017-10-05 17:33:50 -07:00
Tomas Weinfurt e12d604d93 Add minimal handling for HTTP 1.0 requests to ManagedHandler (dotnet/corefx#23653)
* add minimal handling for 1.0 requests.

* use 1.1 as default version and move some message to resource file

* fix spelling

* remove exception for 2.0 requests and fall-back to 1.1

* remove s_spaceHttp20NewlineAsciiBytes as it is not used now

* add isHttp10 bool to avoid duplicate check.


Commit migrated from https://github.com/dotnet/corefx/commit/8b266d0ca4a12428629b3a7abf79c61c29e50883
2017-10-02 23:40:30 -04:00
Stephen Toub 1457854fb7 Address PR feedback
- Have ClientWebSocket change the scheme from http{s} -> ws{s} instead of having HttpClient accept ws{s} urls.
- Use a duplex response stream only when the status code is 101
- Disable a test that relies on connection opening being cancelable


Commit migrated from https://github.com/dotnet/corefx/commit/518ea1c2f8ad882c9829c8c35d27d92063ac67f7
2017-09-28 21:08:28 -04:00
Stephen Toub 761b5f1190 Several HttpClient/ManagedHandler fixes to better support ClientWebSocket
- Allow ws:// and wss:// schemes
- Add an HttpContentDuplexStream base class to parallel the existing HttpContentReadStream and HttpContentWriteStream base classes
- Move more shared functionality down to the base HttpContentStream class
- Make ConnectionCloseStream duplex instead of read-only


Commit migrated from https://github.com/dotnet/corefx/commit/9438b0a760b1ef827729662186e107abccb7524d
2017-09-28 21:08:26 -04:00
Amit Dash 74a3b06d44 Return condition directly instead of if (condition) return true; else return false; (dotnet/corefx#24252)
Commit migrated from https://github.com/dotnet/corefx/commit/27a43b38f3f599e43d8bf845f6eb0f351da762e2
2017-09-26 16:29:06 -07:00
Stephen Toub a013bc3765 Make ConnectHelper.ConnectAsync return ValueTask<Stream> (dotnet/corefx#24244)
Minor optimization via playing a bit better perf-wise with changes being made in coreclr.

Commit migrated from https://github.com/dotnet/corefx/commit/c45e6b3d58af63299aea992848370fced532c6e8
2017-09-26 10:30:44 -04:00
Stephen Toub 1677c52028 Fix some missing ConfigureAwaits in ManagedHandler (dotnet/corefx#24248)
Commit migrated from https://github.com/dotnet/corefx/commit/2f981c6efcd00b4ecee5309697ef07d58605993a
2017-09-26 10:30:13 -04:00
Alfred Myers 185367ce23 Updated link to HTTP Protocol proposal and minor fixes (dotnet/corefx#24216)
Commit migrated from https://github.com/dotnet/corefx/commit/b3033e6bd586fb7bdc2e1afdd1694e790272ce6e
2017-09-25 09:41:07 -04:00
Stephen Toub fc2f8b26e9 Use stackalloc directly into Span (dotnet/corefx#24212)
* Use stackalloc directly into Span

We have a few places in corefx where we were stackalloc'ing into a temporary pointer and then creating a Span from that.  Now that we're using a C# compiler which supports stackalloc'ing directly into span, use that feature instead.

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/a7f6f470cb2c4cdaafdc3ad85e2520992a8db265
2017-09-24 09:45:07 -04:00
Stephen Toub a1491f5511 Merge pull request dotnet/corefx#24173 from stephentoub/managedhandler_optin
Provide an (at least temporary) non-global ManagedHandler opt-in mechanism

Commit migrated from https://github.com/dotnet/corefx/commit/1adc5b27283de6e9627e183ef24e0631ee7bab9a
2017-09-21 20:14:57 -07:00
Stephen Toub e16c674170 Increase file descriptor limit in S.N.Http tests on macOS
Commit migrated from https://github.com/dotnet/corefx/commit/2bce06e38f5c16ec6d6eed96a2c4410110fe5ec6
2017-09-21 21:31:49 -04:00
ahsonkhan 12a9b427d1 Change AsSpan to property Span and rename AsMemory to Memory
Commit migrated from https://github.com/dotnet/corefx/commit/786195a51ca0b751f5aec127faf655fe358c6993
2017-09-21 15:47:42 -04:00
Stephen Toub 7be9b5bb5f Switch tests to use thread-local switch for ManagedHandler
And as a result re-enable parallelism of the test suite, which on my machine reduces the running time of the outerloop tests from 150s to 45s.


Commit migrated from https://github.com/dotnet/corefx/commit/3db504ec31fb03162b33e0658870aef5af4e4abe
2017-09-21 08:26:44 -04:00
Stephen Toub 7d1e89d2b9 Add thread-local based switch to opt-in to ManagedHandler
Commit migrated from https://github.com/dotnet/corefx/commit/7c851fcea84b3e10528c8da9fe4a6edb503e8773
2017-09-20 13:51:14 -04:00
Stephen Toub f87da3dfe0 Wrap exceptions from ManagedHandler's server validation callback (dotnet/corefx#24111)
To match other handlers' behaviors.

Commit migrated from https://github.com/dotnet/corefx/commit/e0b912e37439118651ae12e5685b0ef7efd8f1fd
2017-09-18 11:12:48 -07:00
David Shulman a10c42c864 Wrap cert callback leaked exceptions in WinHttpHandler (dotnet/corefx#24107)
Similar to the fix done for CurlHandler (dotnet/corefx#21938), fix WinHttpHandler so
that leaked exceptions from the user-provided certificate callback are
properly wrapped.

The ManagedHandler still needs to be fixed since it is not wrapping
properly.

Contributes to dotnet/corefx#21904

Commit migrated from https://github.com/dotnet/corefx/commit/ca5d83ec2855afa7ce4f60d9c5b0dd46e1cb2faf
2017-09-17 23:19:28 -04:00
Stephen Toub 29b6641eeb Add ReadOnlyMemoryContent to System.Net.Http (dotnet/corefx#24006)
* Add ReadOnlyMemoryContent to System.Net.Http

Allows `{ReadOnly}Memory<byte>`s to be uploaded in HttpClient requests.

* Address PR feedback

* Address more PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/d183fd34074fba9633f025fe2251e7d7883c7f25
2017-09-13 13:01:15 -07:00
Lakshmi Priya Sekar bf69088386 Merge pull request dotnet/corefx#23868 from Priya91/credentialmh
Remove duplicate bug ids in source code.

Commit migrated from https://github.com/dotnet/corefx/commit/82a45b73d9754ae5e82ce1c699b0c86db712e4fa
2017-09-12 18:55:50 -07:00
Lakshmi Priya Sekar 82a42d0e68 Move test to windows specific.
Commit migrated from https://github.com/dotnet/corefx/commit/b95d60789528d2d920e4d58238ee3fd3260585de
2017-09-12 17:36:53 -07:00
David Shulman c8fcec1e55 Disable unreliable Http diagnostics logging test (dotnet/corefx#23977)
The Http test, SendAsync_ExpectedDiagnosticCancelledLogging, has been
failing at times.

I am going to disable this test until it can be made more robust. It is
not a reliable test because cancellation cannot be guaranteed to occur
with a certain time especially on a busy machine.

dotnet/corefx#23209

Commit migrated from https://github.com/dotnet/corefx/commit/839ace982010b10bef94c9aac1d2eb991f76c383
2017-09-12 13:09:51 -04:00
Lakshmi Priya Sekar cfece7ec46 Move DefaultCredentialsTest to windows only.
Commit migrated from https://github.com/dotnet/corefx/commit/d961c15b20539f5638953e9506d35f49d038237a
2017-09-07 17:25:43 -07:00
Lakshmi Priya Sekar 6ea808c117 Remove duplicate bug ids in source code.
Commit migrated from https://github.com/dotnet/corefx/commit/22c66999a49f73002f8e6b04e54c10c7e5f2fe15
2017-09-07 15:20:41 -07:00
Lakshmi Priya Sekar 23c60bac8f Merge pull request dotnet/corefx#23821 from Priya91/credentialmh
Use only CredentialCache for authentication when redirecting Uris in ManagedHandler.

Commit migrated from https://github.com/dotnet/corefx/commit/2b889c4a2d9877b7112d9a57061b92366d9c257a
2017-09-07 15:11:59 -07:00
Lakshmi Priya Sekar 7bf96b53d4 Consolidate code between different Http handlers.
Commit migrated from https://github.com/dotnet/corefx/commit/5ef59053709ef8b6f5b30b709bffbe38fcb19823
2017-09-07 11:18:43 -07:00
Stephen Toub d37b1e463d Respect UseProxy better in ManagedHandler (dotnet/corefx#23750)
To match CurlHandler, we should only be using environment variable-based proxy configuration if UseProxy is true, but we're currently using it regardless.  This commit fixes that and adds a test for it.

Commit migrated from https://github.com/dotnet/corefx/commit/7615a2c1dde51e0797ed3ffbca70191af2aef79e
2017-09-07 00:11:34 -04:00
David Shulman da2de2ec4a Disable default proxy test on Desktop
HttpClient test ProxyExplicitlyProvided_DefaultCredentials_Ignored has
started failing on Desktop due to build system changes. Disabling for
now.

dotnet/corefx#23702


Commit migrated from https://github.com/dotnet/corefx/commit/2c50d92d6d07173db6ec5c8a6a17085613972a3b
2017-09-06 10:41:14 -07:00
Lakshmi Priya Sekar ec142d891b Use only CredentialCache when redirecting Uris in ManagedHandler.
Commit migrated from https://github.com/dotnet/corefx/commit/9d5f5d1f8630e3c50404647926496b0d45cf1203
2017-09-05 18:26:43 -07:00
Stephen Toub 45558100d1 Enable disabled HttpClientEKUTests on ManagedHandler (dotnet/corefx#23754)
They appear to all be passing now.

Commit migrated from https://github.com/dotnet/corefx/commit/2443b0d5f2a25f9c619aff9dca8ec2625eba1c96
2017-09-03 19:07:47 -04:00