From dea8220e69421b89492290697e1cce3231fddc06 Mon Sep 17 00:00:00 2001 From: sta Date: Wed, 14 Mar 2018 17:01:06 +0900 Subject: [PATCH] [Modify] Replace it --- websocket-sharp/Net/HttpListenerRequest.cs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/websocket-sharp/Net/HttpListenerRequest.cs b/websocket-sharp/Net/HttpListenerRequest.cs index a9c30e9c..e25e40f8 100644 --- a/websocket-sharp/Net/HttpListenerRequest.cs +++ b/websocket-sharp/Net/HttpListenerRequest.cs @@ -582,15 +582,6 @@ namespace WebSocketSharp.Net private void finishInitialization10 () { - var validMethod = _httpMethod == "GET" - || _httpMethod == "HEAD" - || _httpMethod == "POST"; - - if (!validMethod) { - _context.ErrorMessage = "Invalid request line (method)"; - return; - } - if (_httpMethod == "POST") { if (_contentLength == -1) { _context.ErrorMessage = "Content-Length header required"; @@ -820,6 +811,11 @@ namespace WebSocketSharp.Net return; } + if (!method.IsHttpMethod (ver)) { + _context.ErrorMessage = "Invalid request line (method)"; + return; + } + _httpMethod = method; _rawUrl = target; _protocolVersion = ver;