# File lib/cgikit/webrick.rb, line 50
    def run(request, response)
      # set request
      headers = request.meta_vars
      
      ##############################################################################
      # This implementation is DANGEROUS and not elemegant. If WEBrick is updated, #
      # it is necessary to modify these lines.                                     #
      ##############################################################################
      
      input = request.instance_variable_get('@socket')
      # Why is this line needed?
      request.instance_variable_set('@socket', nil)
      
      params = CGIKit::Utilities.query_from_headers(headers, input)
      ckrequest = CGIKit::Request.new(headers, params)
      
      # run
      if block_given?
        ckresponse = yield(ckrequest)
      end

      # set response
      response.request_http_version = ckresponse.http_version
      response.status = ckresponse.status
      ckresponse.headers.each{|key, val|
        if LEAVE_HEADER[key]
          response[key] = val
        end
      }
      response['Content-Type'] = ckresponse.headers['Content-Type']
      if ckresponse.encoding
        response['Content-Type'] << "; charset=#{ckresponse.encoding}"
      end
      ckresponse.cookies.each{|cookie|
        response.cookies << cookie
      }

      response.body = ckresponse.content
    end