這里寫問題描述
workerman http服務(wù)為什么不支持Transfer-Encoding=chunked的請求頭,直接返回http code = 400,為什么要這么做呢
if ($pos = \strpos($header, "\r\nContent-Length: ")) {
$length = $length + (int)\substr($header, $pos + 18, 10);
$has_content_length = true;
} else if (\preg_match("/\r\ncontent-length: ?(\d+)/i", $header, $match)) {
$length = $length + $match[1];
$has_content_length = true;
} else {
$has_content_length = false;
if (false !== stripos($header, "\r\nTransfer-Encoding:")) {//
$connection->close("HTTP/1.1 400 Bad Request\r\n\r\n", true);
return 0;
}
}