CGI.new plus exception handling. CGI#read_multipart raises EOFError if body.empty? or body.size != Content-Length and raises ArgumentError if Content-Length is non-integer.
Source Code
# File dispatcher.rb, line 99 def new_cgi(output) failsafe_response(output, '400 Bad Request') { CGI.new } end
<code/>and<pre/>for code samples.