parse_body (lib/requests/request_parser.rb:66-73) only reads a body when `Content-Length` is present:
def parse_body(stream:, method:, headers:)
return nil unless %w[POST PUT PATCH].include?(method)
content_length = headers['content-length']&.first&.to_i
return nil unless content_length&.positive?
stream.read(content_length)
end
Transfer-Encoding: chunked is never checked, so chunked body bytes are never consumed from the stream. handle_connection reuses the same stream across requests on a keep-alive connection, so the next request's stream.gets reads leftover chunk data as if it were a new request line — garbage parses or hangs, not just a rejected single request.
Not sure if chunked support is on the roadmap already — flagging in case it's a surprise gap rather than a known one.
parse_body(lib/requests/request_parser.rb:66-73) only reads a body when `Content-Length` is present:Transfer-Encoding: chunkedis never checked, so chunked body bytes are never consumed from the stream.handle_connectionreuses the same stream across requests on a keep-alive connection, so the next request'sstream.getsreads leftover chunk data as if it were a new request line — garbage parses or hangs, not just a rejected single request.Not sure if chunked support is on the roadmap already — flagging in case it's a surprise gap rather than a known one.