[Modify] Polish it

This commit is contained in:
sta 2018-02-16 17:03:10 +09:00
parent 2be3a3626b
commit 05b411a093

View File

@ -676,10 +676,8 @@ namespace WebSocketSharp.Net
internal void FinishInitialization ()
{
var host = _headers["Host"];
var hasHost = host != null && host.Length > 0;
if (_protocolVersion > HttpVersion.Version10 && !hasHost) {
_context.ErrorMessage = "Invalid Host header";
if (_protocolVersion > HttpVersion.Version10 && !_userHostNameSet) {
_context.ErrorMessage = "No Host header";
return;
}