[Modify] Polish it

This commit is contained in:
sta 2020-12-31 17:30:31 +09:00
parent 605ae9173e
commit 45db0ea477

View File

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