From 05b411a093e7e2c861d6ce603d0f088b53e0cbb1 Mon Sep 17 00:00:00 2001 From: sta Date: Fri, 16 Feb 2018 17:03:10 +0900 Subject: [PATCH] [Modify] Polish it --- websocket-sharp/Net/HttpListenerRequest.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/websocket-sharp/Net/HttpListenerRequest.cs b/websocket-sharp/Net/HttpListenerRequest.cs index 0682280b..5af40611 100644 --- a/websocket-sharp/Net/HttpListenerRequest.cs +++ b/websocket-sharp/Net/HttpListenerRequest.cs @@ -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; }