[Modify] Replace it

This commit is contained in:
sta 2018-03-14 17:01:06 +09:00
parent 9ba935f723
commit dea8220e69

View File

@ -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;