Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Commit b2611a2

Browse files
committed
Simpler Connection test
1 parent 4f773ab commit b2611a2

File tree

1 file changed

+4
-16
lines changed
  • src/Microsoft.AspNet.Server.Kestrel/Http

1 file changed

+4
-16
lines changed

src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -642,23 +642,11 @@ private Task CreateResponseHeader(
642642
var end = begin;
643643
if (_keepAlive && _responseHeaders.HasConnection)
644644
{
645-
var count = _responseHeaders.HeaderConnection.Count;
646-
if (count == 1)
645+
var connection = _responseHeaders.HeaderConnection.ToString();
646+
647+
if (connection.IndexOf("close", StringComparison.OrdinalIgnoreCase) != -1)
647648
{
648-
if (_responseHeaders.HeaderConnection[0].IndexOf("close", StringComparison.OrdinalIgnoreCase) != -1)
649-
{
650-
_keepAlive = false;
651-
}
652-
}
653-
else if (count > 1)
654-
{
655-
foreach (var connectionValue in _responseHeaders.HeaderConnection)
656-
{
657-
if (connectionValue.IndexOf("close", StringComparison.OrdinalIgnoreCase) != -1)
658-
{
659-
_keepAlive = false;
660-
}
661-
}
649+
_keepAlive = false;
662650
}
663651
}
664652

0 commit comments

Comments
 (0)