diff options
author | Stephen Toub <stoub@microsoft.com> | 2017-04-20 17:30:52 +0300 |
---|---|---|
committer | Stephen Toub <stoub@microsoft.com> | 2017-04-20 17:30:52 +0300 |
commit | 6cc94d33dfea93d4e3d1c83dd23fea3557d604ce (patch) | |
tree | d12568a5bded3b4948fe843146dcc771ae090330 /src | |
parent | 5310d8421ad13be6d696e01ab462f77c508f0a70 (diff) |
Fix recently added KeepAlive test on desktop
The WinHTTP implementation sends Connection: "keep-alive", the desktop implementation does not. Just change the test to validate whether Connection: "close" is sent or not.
Diffstat (limited to 'src')
-rw-r--r-- | src/System.Net.Requests/tests/HttpWebRequestHeaderTest.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/System.Net.Requests/tests/HttpWebRequestHeaderTest.cs b/src/System.Net.Requests/tests/HttpWebRequestHeaderTest.cs index 3bf8d34452..714c3ebd0a 100644 --- a/src/System.Net.Requests/tests/HttpWebRequestHeaderTest.cs +++ b/src/System.Net.Requests/tests/HttpWebRequestHeaderTest.cs @@ -241,7 +241,9 @@ namespace System.Net.Tests string content = body.ReadToEnd(); if (!keepAlive.HasValue || keepAlive.Value) { - Assert.Contains("\"Connection\": \"Keep-Alive\"", content, StringComparison.OrdinalIgnoreCase); + // Validate that the request doesn't contain Connection: "close", but we can't validate + // that it does contain Connection: "keep-alive", as that's optional as of HTTP 1.1. + Assert.DoesNotContain("\"Connection\": \"close\"", content, StringComparison.OrdinalIgnoreCase); } else { |