workerman http为什么不支持Transfer-Encoding=chunked的消息头

yzmdd

问题描述

这里写问题描述

workerman http服务为什么不支持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;
            }
        }
645 1 1
1个回答

walkor

Transfer-Encoding=chunked的请求用法很少,没做支持。没有其它特别原因。

  • 暂无评论
年代过于久远,无法发表回答
🔝