Commit Graph
1318 Commits
Author SHA1 Message Date
Tarek Mahmoud Sayed 78e14f5cea Modify High Sierra Check and Fix TZ Test (dotnet/corefx#23171)
Commit migrated from https://github.com/dotnet/corefx/commit/bdb3ef6ec7a7106c439796a27ec448e0e406310c
2017-08-14 08:46:56 -07:00
Stephen Toub e2218fc078 Add Expect: 100-continue support to ManagedHandler (dotnet/corefx#23196)
Commit migrated from https://github.com/dotnet/corefx/commit/791f81d2d8eb45e5077d2c0c17e784ad597c5e3a
2017-08-14 08:42:01 -04:00
Stephen Toub 945d60b1f5 Enable full duplex communication with ManagedHandler (dotnet/corefx#23180)
* Enable full duplex communication with ManagedHandler

ManagedHandler currently waits for all of the request content to be sent before it processes any response content.  While that matches with what many servers do (not sending any response content until all request content has been received), some sites and situations do benefit from or even require full duplex communication, such that the response can be processed even while the request content is being sent.  This change is also a necessary step towards enabling Expect: 100-continue, as we need to be able to receive the response header before having sent the content, and even without Expect: 100-continue, this allows us to stop sending a large request body if a server quickly sends back a status indicating the transfer isn't needed (e.g. a redirect).

This change also improves on the cancellation support for sending the request body.  The send cancellation token is now embedded in the request content stream and uses that token for all operations.

* Address PR feedback

- Don't force flush the headers before sending content.
- Skip the write buffer when using ContentLengthWriteStream
- Fix some typos


Commit migrated from https://github.com/dotnet/corefx/commit/a326d79a4fac6e82839ab1d672a2e536b6c81754
2017-08-13 06:07:13 -04:00
Geoff Kizer 64b0d71cc3 Merge pull request dotnet/corefx#23091 from geoffkizer/httpheaderdescriptor
add HeaderDescriptor and use as key for header store

Commit migrated from https://github.com/dotnet/corefx/commit/3e72ee5971db5d0bd46606fa672969adde29e307
2017-08-12 21:17:41 -07:00
Geoff Kizer 77f5a27b11 more PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/cf3f5468d547f609e4e54731664c7a12e4ed23ed
2017-08-12 19:19:02 -07:00
Stephen Daudell e93ad01f42 ManagedHandler: Moved exception strings to .resx resources. (dotnet/corefx#23173)
* Moved exception strings to .resx resources.

* Addressed PR feedback.


Commit migrated from https://github.com/dotnet/corefx/commit/2efb83a3170ec14cafe6a14ea37edb037eb99836
2017-08-12 14:07:46 -04:00
Geoff Kizer 8aeb4c0aa9 better fix for ToUpper thing
Commit migrated from https://github.com/dotnet/corefx/commit/e241e262a8bfbd0b85b1364b678e79366e4a5f51
2017-08-11 17:01:53 -07:00
Geoff Kizer e519368a1a avoid ToUpperInvariant since we are just dealing with ascii
Commit migrated from https://github.com/dotnet/corefx/commit/09b012d075f79f04c44a6bcab3b5477f2e363144
2017-08-11 16:18:22 -07:00
Geoff Kizer 7d5f513074 defer token check in HeaderDescriptor.TryGet to after the known header lookup
Commit migrated from https://github.com/dotnet/corefx/commit/1a04a49325bd8450758896d0a7aa3add751a514f
2017-08-11 15:47:37 -07:00
Stephen Toub 50805a924a Update TODOs with issue numbers
Commit migrated from https://github.com/dotnet/corefx/commit/924d34b8a04eb1bc0f005848d784d7d414d0d4d3
2017-08-11 15:34:57 -04:00
Stephen Toub 8bfc1f89b1 Fix potential deadlocks in HttpClient tests
A bunch of tests have the following structure:
```C#
var clientTask = hc.GetAsync(...);
await server.HandleRequest();
Handle(await clientTask);
```
If the HttpClient request fails in a way that causes the server not to receive the request, the test will hang, as the await for the server operation to complete will never complete.

This commit changes a bunch of the tests to avoid that pattern.  This makes several of the tests disabled due to hanging actually reveal the cause of the problem, e.g. the ManagedHandler not supporting 1.0 requests and failing immediately if provided with that version without making a request to the server.


Commit migrated from https://github.com/dotnet/corefx/commit/e34b6fd99085c69c8fd7a64ed5eb4da5b66f4136
2017-08-11 15:34:06 -04:00
Stephen Toub 5682f2d1f3 Add some more tracing to ManagedHandler
Commit migrated from https://github.com/dotnet/corefx/commit/4b701ae87934156c42923cc1c379171a7a478a2d
2017-08-11 15:34:05 -04:00
Stephen Toub 48a1b245f6 Handle invalid chunk size in ManagedHandler (dotnet/corefx#23160)
To match WinHttpHandler, support chunk sizes up to ulong.MaxValue in size, and throw exceptions for anything larger.

Commit migrated from https://github.com/dotnet/corefx/commit/c8768231c3a272dd6f330dd1cccb9fa69e671915
2017-08-11 15:33:31 -04:00
Stephen Toub ba64391f25 Remove CancellationToken field from StreamContent (dotnet/corefx#23162)
This is a holdover from a previous design, isn't used, but is still taking up space in the StreamContent.  Remove it.

Commit migrated from https://github.com/dotnet/corefx/commit/fe2f34a967270a52bdec65cb09088b28240ea349
2017-08-11 13:58:43 -04:00
Tarek Mahmoud Sayed 3765a6069b Moving PlatformDetection to Corefx.Private.TestUtilities assembly (dotnet/corefx#23109)
* Moving PlatformDetection to Corefx.Private.TestUtilities assembly

The purpose of this change is to clean up all test projects instead of including the PlatformDetection code inside every test project, we’ll have it in the Corefx.Private.TestUtilities.
I have refactored the PlatformDetection to split the different implementation of Windows and Linux. If we need to do more refactoring there we can do it later as needed.

* Fix Linux BB

* Update the xunit package reference

* Fix wrong condition on one of the tests

* Update the ConditionalFact/Theory to use Type as a parameter


Commit migrated from https://github.com/dotnet/corefx/commit/878e2fcf5a9f1068015e5fada9231088663e3490
2017-08-10 22:37:36 -07:00
dstuckims b1fb4f2d2c HttpMethod.ToString(): Remove unnecessary string.ToString() call (dotnet/corefx#23110)
Avoid making a virtual function call when the code already has a string.

Commit migrated from https://github.com/dotnet/corefx/commit/ec35648d54a97b93d44e546f0f781d49b09a9dc3
2017-08-10 14:38:01 -04:00
Geoff Kizer f321f8729d make KnownHeaders statics readonly
Commit migrated from https://github.com/dotnet/corefx/commit/8bbe1fa9cdeabf9776cbccedb0a9aeb03e50fb7c
2017-08-09 22:42:55 -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 998128e256 fix Linux build
Commit migrated from https://github.com/dotnet/corefx/commit/f84db4c9ad05aef1f2d2a9d6e72ebcf4c9ab9b90
2017-08-09 21:20:25 -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 0583436bca Use different RNG.GetBytes in two places (dotnet/corefx#23053)
- In ManagedWebSocket, there's no need to use a [ThreadStatic] to store a byte array into which we get random bytes that are then copied to the right portion of the destination array... we can just generate directly into the destination array.
- In ManagedHandler, we can use the new Span-based overload to avoid needing to allocate a 1-byte array (and we certainly don't need to allocate such an array 16 times).

Commit migrated from https://github.com/dotnet/corefx/commit/58024e5486531128c6ecf8f46ae7021343550fa9
2017-08-08 17:46:09 -04:00
David Shulman 3b0d3fbb4e Update UAP test regarding 'TRACE' method (dotnet/corefx#22973)
* Address delayed feedback

Address delayed feedback from PR dotnet/corefx#22702 and release/uwp6.0 port PR
dotnet/corefx#22759

* Remove active issue on Uap TRACE test

Uap platform doesn't support the 'TRACE' verb.  After discussion with
Wininet team, the method is explicitly not allowed. So, removing the
activeissue and just skipping that part of the test.

Fixes dotnet/corefx#22161


Commit migrated from https://github.com/dotnet/corefx/commit/f7bc8b413406e94549f21be79e67641f11ae8266
2017-08-04 23:38:39 -07:00
Lakshmi Priya Sekar ef471ce6ea Merge pull request dotnet/corefx#22841 from Priya91/digest2
Support username* and Proxy-Authorization for digest auth.

Commit migrated from https://github.com/dotnet/corefx/commit/b769a73ecf278f92993a8b789aaaaedbc55a7dc3
2017-08-03 17:04:32 -07:00
Shin Mao a4570ea682 System.Net.CookieParser to Support Cookie String with Trailing Semicolon (dotnet/corefx#22895)
* Fix CookieTokenizer

* Add tests for CookieParser.

* Changes in test.

* Change Facts to Theory

* Added more tests.


Commit migrated from https://github.com/dotnet/corefx/commit/c714216f2a07a8b9963839b5c87b56f33ec0327e
2017-08-03 15:37:39 -07:00
Lakshmi Priya Sekar b22f847e1c Re-make changes with latest master improvements.
Commit migrated from https://github.com/dotnet/corefx/commit/a78fb1298530ea6fda02176fe19ca423d2707981
2017-08-03 12:59:27 -07:00
Lakshmi Priya Sekar 47fa09f560 Include userhash key when username hashed.
Commit migrated from https://github.com/dotnet/corefx/commit/78487b856b9646fe4e8de81ece0f3ca893ef07ac
2017-08-03 12:51:43 -07:00
Lakshmi Priya Sekar d14642f5f6 No quotes for username*
Commit migrated from https://github.com/dotnet/corefx/commit/08b6d9e767f7417084781d2373fe5856dc59ae00
2017-08-03 12:51:43 -07:00
Lakshmi Priya Sekar 73a4898956 Respond to PR feedback.
Commit migrated from https://github.com/dotnet/corefx/commit/41cd8462457a04c6cf6a38a17a74ce06b838a673
2017-08-03 12:51:42 -07:00
Lakshmi Priya Sekar 34f5e20533 Use username* for usernames with reserved chars.
Commit migrated from https://github.com/dotnet/corefx/commit/db393a7835c76486a6a5a9f8eb1d81820c261ca7
2017-08-03 12:51:42 -07:00
Lakshmi Priya Sekar ee12332f74 Support digest auth for Proxy authentication in managedhandler.
Commit migrated from https://github.com/dotnet/corefx/commit/a1e8bc37d3c071b59d1bf7406e23b077fe2b693b
2017-08-03 12:46:30 -07:00
Stephen Toub 7e8d887b2f Fix ManagedHandler environment proxy setting handling (dotnet/corefx#22898)
Missing a clause resulting in test failures.

Commit migrated from https://github.com/dotnet/corefx/commit/c7d8cbfd921b3153b301cca777056b361783a3d2
2017-08-03 07:53:29 -04: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 c4562d3b87 Add basic EventSource tracing to ManagedHandler (dotnet/corefx#22867)
* Add basic EventSource tracing to ManagedHandler

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/2c986e4f1658708242b2fe0d39bf8cbff88f0eaa
2017-08-02 16:43:27 -04:00
Cristian Pop 88d0c2191b Enabling HttpClient EKU tests. (dotnet/corefx#22737)
Commit migrated from https://github.com/dotnet/corefx/commit/339f2223df42e4b7604b990ab1ce1b25c49bb662
2017-07-28 19:50:39 -07:00
Lakshmi Priya Sekar 0974a2809e Merge pull request dotnet/corefx#22676 from Priya91/digest
Implement digest authentication for ManagedHandler.

Commit migrated from https://github.com/dotnet/corefx/commit/0485dc0aa5248d23878c08c710f0852115a72ab0
2017-07-28 17:40:58 -07:00
David Shulman bf75c2d777 Fix HttpClient redirection logic on UAP (dotnet/corefx#22702)
* Fix HttpClient redirection logic on UAP

This PR changes the implementation of sending requests in HttpClient for UAP when
dealing with redirection. In the past, we would let the WinRT layer handle auto
redirection logic. However, due to dotnet/corefx#9003, the cookies were getting lost on 3xx responses
since the .NET layer didn't see them. So, this PR implements the redirection ourselves.

One important part of redirection is that we need to drop credentials. The WinRT layer
did this for us. However, we are unable to use a single WinRT HttpBaseProtocolFilter object
since we need to remove the credential after the first redirect. So, we need to maintain
a second filter that uses no credentials and keep it in sync regarding all the other properties
of the primary filter.

With this PR, the behavior of other aspects (such as controlling max number of redirects, etc.)
now matches .NET Framework.  So, some tests were adjusted to remove the UAP specific behavior
checks.

Fixes dotnet/corefx#9003
Fixes dotnet/corefx#22191

* Disable test on Linux

* Address PR feedback

* Disable failing HTTP/2 test


Commit migrated from https://github.com/dotnet/corefx/commit/f2308f8db0679ac63e8e7eeac9d56cb035d6d9e3
2017-07-28 16:43:40 -07:00
Lakshmi Priya Sekar d473352c04 Check for mandatory values from challenge, return null if not present.
Commit migrated from https://github.com/dotnet/corefx/commit/3f01ae65c39c5fbf66963198f9d6d2dfff948f9d
2017-07-28 15:18:57 -07:00
Lakshmi Priya Sekar efa8136cf3 Add retry option for digest auth in case of server nonce timeout.
Commit migrated from https://github.com/dotnet/corefx/commit/13fc5afad0127d69717973842f49f5cc6df65c75
2017-07-28 15:18:56 -07:00
Lakshmi Priya Sekar 2b7923495a Respond to PR feedback.
Commit migrated from https://github.com/dotnet/corefx/commit/0c910ac2778eb4dc9ae175cda539c6704011927a
2017-07-27 18:34:15 -07:00
Lakshmi Priya Sekar f4ff56e98b Implement digest authentication for ManagedHandler.
Commit migrated from https://github.com/dotnet/corefx/commit/75fbb6235a08fc3f24ce123204b217d7088630f3
2017-07-26 21:09:28 -07:00
Stephen Toub a460718ac5 Fix several test failures
Commit migrated from https://github.com/dotnet/corefx/commit/d659a500dd349eb570e074b95de265b9254dda7e
2017-07-25 16:21:00 -04:00
Stephen Toub 09a164fc78 Avoid compiler issues with Span being lifted to a state machine
Commit migrated from https://github.com/dotnet/corefx/commit/6af9d4ebf22fb5846971174b3b045b6efd2406b4
2017-07-25 12:34:22 -04:00
Stephen Toub 1619be0b81 Remove several fields from async state machines
Commit migrated from https://github.com/dotnet/corefx/commit/310498943b3602a1656528ac88ffa800b30f13fe
2017-07-25 12:34:22 -04:00
Stephen Toub 9de3bc4b5e Several more tweaks
- Use Span instead of ArraySegment where possible
- Consolidate throws into a helper that uses a resource string
- Improve reading of CrLf
- Improve writing of end of chunks


Commit migrated from https://github.com/dotnet/corefx/commit/e09f35cb49f03ce79ee163df5e1008f68689d25e
2017-07-25 12:34:22 -04:00
Stephen Toub 0b5f831169 Separate classes into their own files
Commit migrated from https://github.com/dotnet/corefx/commit/2ede81f8bbb7005d3895be224bd8b861cccae8c2
2017-07-25 12:34:22 -04:00
Stephen Toub 78d5a48cde Employ single empty response stream
Commit migrated from https://github.com/dotnet/corefx/commit/79804fa238eb57648f616f1a0577164f66f5bccc
2017-07-25 12:34:21 -04:00
Stephen Toub 034c3ab9a0 Read header lines asynchronously line-by-line rather than byte-by-byte
Commit migrated from https://github.com/dotnet/corefx/commit/398a1bc8bc9d3207af5267816a350a378ae1ddf1
2017-07-25 12:34:21 -04:00
Stephen Toub 11dea4f52d Disable default proxy credentials tests for managed handler (dotnet/corefx#22495)
One of these tests is now hanging on Unix after the updated connection
pooling changes went in.  Disabling for now.

Commit migrated from https://github.com/dotnet/corefx/commit/5c169a30fb200bd17fb49439c633d2a11773802d
2017-07-21 10:28:50 -04:00
Stephen Toub 01c662fdfd Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/4feb7fa2fcd2a2a4062a3ba8df4a2233d97af644
2017-07-20 17:15:39 -04:00