Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStephen Toub <stoub@microsoft.com>2017-04-20 17:30:52 +0300
committerStephen Toub <stoub@microsoft.com>2017-04-20 17:30:52 +0300
commit6cc94d33dfea93d4e3d1c83dd23fea3557d604ce (patch)
treed12568a5bded3b4948fe843146dcc771ae090330 /src
parent5310d8421ad13be6d696e01ab462f77c508f0a70 (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.cs4
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
{