From 3c9eb649e43933cf602c21742894be49c9e982ae Mon Sep 17 00:00:00 2001 From: sta Date: Fri, 22 Jan 2021 19:47:29 +0900 Subject: [PATCH] [Modify] Only support HTTP/1.1 --- websocket-sharp/Net/HttpListenerRequest.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/websocket-sharp/Net/HttpListenerRequest.cs b/websocket-sharp/Net/HttpListenerRequest.cs index 6d7d6c26..2b06d7dd 100644 --- a/websocket-sharp/Net/HttpListenerRequest.cs +++ b/websocket-sharp/Net/HttpListenerRequest.cs @@ -343,9 +343,7 @@ namespace WebSocketSharp.Net /// public bool IsWebSocketRequest { get { - return _httpMethod == "GET" - && _protocolVersion > HttpVersion.Version10 - && _headers.Upgrades ("websocket"); + return _httpMethod == "GET" && _headers.Upgrades ("websocket"); } } @@ -714,12 +712,6 @@ namespace WebSocketSharp.Net internal void FinishInitialization () { - if (_protocolVersion == HttpVersion.Version10) { - finishInitialization10 (); - - return; - } - if (_userHostName == null) { _context.ErrorMessage = "Host header required"; @@ -853,8 +845,9 @@ namespace WebSocketSharp.Net return; } - if (ver.Major < 1) { + if (ver != HttpVersion.Version11) { _context.ErrorMessage = "Invalid request line (version)"; + _context.ErrorStatusCode = 505; return; }