Module: CGI::QueryExtension

Defined in:
lib/action_controller/cgi_ext/raw_post_data_fix.rb

Overview

Add @request.env for the vegans.

Instance Method Summary collapse

Instance Method Details

#initialize_queryObject

Initialize the data from the query.

Handles multipart forms (in particular, forms that involve file uploads). Reads query parameters in the @params field, and cookies into @cookies.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/action_controller/cgi_ext/raw_post_data_fix.rb', line 8

def initialize_query()
  if boundary = multipart_form_boundary
    @multipart = true
    @params = read_multipart(boundary, Integer(env_table['CONTENT_LENGTH']))
  else
    @multipart = false
    @params = CGI::parse(read_query_params)
  end
  
  @cookies = CGI::Cookie::parse((env_table['HTTP_COOKIE'] || env_table['COOKIE']))
end