Control-flow simplification in Frame.CreateResponseHeader() (#1168).
This commit is contained in:
parent
610601cc6e
commit
d64b4c7acb
|
|
@ -865,13 +865,16 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
|
||||||
|
|
||||||
responseHeaders.SetReadOnly();
|
responseHeaders.SetReadOnly();
|
||||||
|
|
||||||
if (!_keepAlive && !hasConnection)
|
if (!hasConnection)
|
||||||
{
|
{
|
||||||
responseHeaders.SetRawConnection("close", _bytesConnectionClose);
|
if (!_keepAlive)
|
||||||
}
|
{
|
||||||
else if (_keepAlive && !hasConnection && _httpVersion == Http.HttpVersion.Http10)
|
responseHeaders.SetRawConnection("close", _bytesConnectionClose);
|
||||||
{
|
}
|
||||||
responseHeaders.SetRawConnection("keep-alive", _bytesConnectionKeepAlive);
|
else if (_httpVersion == Http.HttpVersion.Http10)
|
||||||
|
{
|
||||||
|
responseHeaders.SetRawConnection("keep-alive", _bytesConnectionKeepAlive);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ServerOptions.AddServerHeader && !responseHeaders.HasServer)
|
if (ServerOptions.AddServerHeader && !responseHeaders.HasServer)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue