diff --git a/websocket-sharp/Net/HttpListenerRequest.cs b/websocket-sharp/Net/HttpListenerRequest.cs index b051e185..19dc4fa9 100644 --- a/websocket-sharp/Net/HttpListenerRequest.cs +++ b/websocket-sharp/Net/HttpListenerRequest.cs @@ -583,19 +583,23 @@ namespace WebSocketSharp.Net private void finishInitialization10 () { var transferEnc = _headers["Transfer-Encoding"]; + if (transferEnc != null) { _context.ErrorMessage = "Invalid Transfer-Encoding header"; + return; } if (_httpMethod == "POST") { if (_contentLength == -1) { _context.ErrorMessage = "Content-Length header required"; + return; } if (_contentLength == 0) { _context.ErrorMessage = "Invalid Content-Length header"; + return; } }