Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 6733

Show
Ignore:
Timestamp:
05/15/07 00:08:05 (1 year ago)
Author:
bitsweat
Message:

Shine some sunlight on the CGI extensions. Remove unused CGI#session.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_controller/cgi_ext/cookie.rb

    r3039 r6733  
    11CGI.module_eval { remove_const "Cookie" } 
    22 
     3# TODO: document how this differs from stdlib CGI::Cookie 
    34class CGI #:nodoc: 
    4   # This is a cookie class that fixes the performance problems with the default one that ships with 1.8.1 and below. 
    5   # It replaces the inheritance on SimpleDelegator with DelegateClass(Array) following the suggestion from Matz on 
    6   # http://groups.google.com/groups?th=e3a4e68ba042f842&seekm=c3sioe%241qvm%241%40news.cybercity.dk#link14 
    75  class Cookie < DelegateClass(Array) 
    86    # Create a new CGI::Cookie object. 
     
    2018    # expires:: the time at which this cookie expires, as a +Time+ object. 
    2119    # secure:: whether this cookie is a secure cookie or not (default to 
    22     #          false).  Secure cookies are only transmitted to HTTPS  
     20    #          false).  Secure cookies are only transmitted to HTTPS 
    2321    #          servers. 
    2422    # 
     
    4038        @path = name['path'] 
    4139      end 
    42        
     40 
    4341      unless @name 
    4442        raise ArgumentError, "`name' required" 
  • trunk/actionpack/lib/action_controller/cgi_ext/parameters.rb

    r6732 r6733  
    11require 'cgi' 
    2 require 'cgi/session' 
    3 require 'cgi/session/pstore' 
    4 require 'action_controller/cgi_ext/cgi_methods' 
    5  
    6 # Wrapper around the CGIMethods that have been secluded to allow testing without  
    7 # an instantiated CGI object 
     2require 'strscan' 
     3 
    84class CGI #:nodoc: 
    95  class << self 
     
    1410    end 
    1511  end 
    16    
    17   # Returns a parameter hash including values from both the request (POST/GET) 
    18   # and the query string with the latter taking precedence. 
    19   def parameters 
    20     request_parameters.update(query_parameters) 
    21   end 
    22  
    23   def query_parameters 
    24     CGIMethods.parse_query_parameters(query_string) 
    25   end 
    26  
    27   def request_parameters 
    28     CGIMethods.parse_request_parameters(params, env_table) 
    29   end 
    30    
    31   def session(parameters = nil) 
    32     parameters = {} if parameters.nil? 
    33     parameters['database_manager'] = CGI::Session::PStore 
    34     CGI::Session.new(self, parameters) 
     12end 
     13 
     14module ActionController 
     15  module CgiExt 
     16    module Parameters 
     17      def self.included(base) 
     18        base.extend ClassMethods 
     19      end 
     20 
     21      # Merge POST and GET parameters from the request body and query string, 
     22      # with GET parameters taking precedence. 
     23      def parameters 
     24        request_parameters.update(query_parameters) 
     25      end 
     26 
     27      def query_parameters 
     28        self.class.parse_query_parameters(query_string) 
     29      end 
     30 
     31      def request_parameters 
     32        self.class.parse_request_parameters(params, env_table) 
     33      end 
     34 
     35      module ClassMethods 
     36        # DEPRECATED: Use parse_form_encoded_parameters 
     37        def parse_query_parameters(query_string) 
     38          pairs = query_string.split('&').collect do |chunk| 
     39            next if chunk.empty? 
     40            key, value = chunk.split('=', 2) 
     41            next if key.empty? 
     42            value = value.nil? ? nil : CGI.unescape(value) 
     43            [ CGI.unescape(key), value ] 
     44          end.compact 
     45 
     46          FormEncodedPairParser.new(pairs).result 
     47        end 
     48 
     49        # DEPRECATED: Use parse_form_encoded_parameters 
     50        def parse_request_parameters(params) 
     51          parser = FormEncodedPairParser.new 
     52 
     53          params = params.dup 
     54          until params.empty? 
     55            for key, value in params 
     56              if key.blank? 
     57                params.delete key 
     58              elsif !key.include?('[') 
     59                # much faster to test for the most common case first (GET) 
     60                # and avoid the call to build_deep_hash 
     61                parser.result[key] = get_typed_value(value[0]) 
     62                params.delete key 
     63              elsif value.is_a?(Array) 
     64                parser.parse(key, get_typed_value(value.shift)) 
     65                params.delete key if value.empty? 
     66              else 
     67                raise TypeError, "Expected array, found #{value.inspect}" 
     68              end 
     69            end 
     70          end 
     71 
     72          parser.result 
     73        end 
     74 
     75        def parse_formatted_request_parameters(mime_type, raw_post_data) 
     76          case strategy = ActionController::Base.param_parsers[mime_type] 
     77            when Proc 
     78              strategy.call(raw_post_data) 
     79            when :xml_simple, :xml_node 
     80              raw_post_data.blank? ? {} : Hash.from_xml(raw_post_data).with_indifferent_access 
     81            when :yaml 
     82              YAML.load(raw_post_data) 
     83          end 
     84        rescue Exception => e # YAML, XML or Ruby code block errors 
     85          { "exception" => "#{e.message} (#{e.class})", "backtrace" => e.backtrace, 
     86            "raw_post_data" => raw_post_data, "format" => mime_type } 
     87        end 
     88 
     89        private 
     90          def get_typed_value(value) 
     91            case value 
     92              when String 
     93                value 
     94              when NilClass 
     95                '' 
     96              when Array 
     97                value.map { |v| get_typed_value(v) } 
     98              else 
     99                # Uploaded file provides content type and filename. 
     100                if value.respond_to?(:content_type) && 
     101                      !value.content_type.blank? && 
     102                      !value.original_filename.blank? 
     103                  unless value.respond_to?(:full_original_filename) 
     104                    class << value 
     105                      alias_method :full_original_filename, :original_filename 
     106 
     107                      # Take the basename of the upload's original filename. 
     108                      # This handles the full Windows paths given by Internet Explorer 
     109                      # (and perhaps other broken user agents) without affecting 
     110                      # those which give the lone filename. 
     111                      # The Windows regexp is adapted from Perl's File::Basename. 
     112                      def original_filename 
     113                        if md = /^(?:.*[:\\\/])?(.*)/m.match(full_original_filename) 
     114                          md.captures.first 
     115                        else 
     116                          File.basename full_original_filename 
     117                        end 
     118                      end 
     119                    end 
     120                  end 
     121 
     122                  # Return the same value after overriding original_filename. 
     123                  value 
     124 
     125                # Multipart values may have content type, but no filename. 
     126                elsif value.respond_to?(:read) 
     127                  result = value.read 
     128                  value.rewind 
     129                  result 
     130 
     131                # Unknown value, neither string nor multipart. 
     132                else 
     133                  raise "Unknown form value: #{value.inspect}" 
     134                end 
     135            end 
     136          end 
     137      end 
     138 
     139      class FormEncodedPairParser < StringScanner #:nodoc: 
     140        attr_reader :top, :parent, :result 
     141 
     142        def initialize(pairs = []) 
     143          super('') 
     144          @result = {} 
     145          pairs.each { |key, value| parse(key, value) } 
     146        end 
     147 
     148        KEY_REGEXP = %r{([^\[\]=&]+)} 
     149        BRACKETED_KEY_REGEXP = %r{\[([^\[\]=&]+)\]} 
     150 
     151        # Parse the query string 
     152        def parse(key, value) 
     153          self.string = key 
     154          @top, @parent = result, nil 
     155 
     156          # First scan the bare key 
     157          key = scan(KEY_REGEXP) or return 
     158          key = post_key_check(key) 
     159 
     160          # Then scan as many nestings as present 
     161          until eos? 
     162            r = scan(BRACKETED_KEY_REGEXP) or return 
     163            key = self[1] 
     164            key = post_key_check(key) 
     165          end 
     166 
     167          bind(key, value) 
     168        end 
     169 
     170        private 
     171          # After we see a key, we must look ahead to determine our next action. Cases: 
     172          # 
     173          #   [] follows the key. Then the value must be an array. 
     174          #   = follows the key. (A value comes next) 
     175          #   & or the end of string follows the key. Then the key is a flag. 
     176          #   otherwise, a hash follows the key. 
     177          def post_key_check(key) 
     178            if scan(/\[\]/) # a[b][] indicates that b is an array 
     179              container(key, Array) 
     180              nil 
     181            elsif check(/\[[^\]]/) # a[b] indicates that a is a hash 
     182              container(key, Hash) 
     183              nil 
     184            else # End of key? We do nothing. 
     185              key 
     186            end 
     187          end 
     188 
     189          # Add a container to the stack. 
     190          def container(key, klass) 
     191            type_conflict! klass, top[key] if top.is_a?(Hash) && top.key?(key) && ! top[key].is_a?(klass) 
     192            value = bind(key, klass.new) 
     193            type_conflict! klass, value unless value.is_a?(klass) 
     194            push(value) 
     195          end 
     196 
     197          # Push a value onto the 'stack', which is actually only the top 2 items. 
     198          def push(value) 
     199            @parent, @top = @top, value 
     200          end 
     201 
     202          # Bind a key (which may be nil for items in an array) to the provided value. 
     203          def bind(key, value) 
     204            if top.is_a? Array 
     205              if key 
     206                if top[-1].is_a?(Hash) && ! top[-1].key?(key) 
     207                  top[-1][key] = value 
     208                else 
     209                  top << {key => value}.with_indifferent_access 
     210                  push top.last 
     211                end 
     212              else 
     213                top << value 
     214              end 
     215            elsif top.is_a? Hash 
     216              key = CGI.unescape(key) 
     217              parent << (@top = {}) if top.key?(key) && parent.is_a?(Array) 
     218              return top[key] ||= value 
     219            else 
     220              raise ArgumentError, "Don't know what to do: top is #{top.inspect}" 
     221            end 
     222 
     223            return value 
     224          end 
     225 
     226          def type_conflict!(klass, value) 
     227            raise TypeError, "Conflicting types for parameter containers. Expected an instance of #{klass} but found an instance of #{value.class}. This can be caused by colliding Array and Hash parameters like qs[]=value&qs[key]=value." 
     228          end 
     229      end 
     230    end 
    35231  end 
    36232end 
  • trunk/actionpack/lib/action_controller/cgi_ext/query_extension.rb

    r6446 r6733  
     1require 'cgi' 
     2 
    13class CGI #:nodoc: 
    24  module QueryExtension 
  • trunk/actionpack/lib/action_controller/cgi_ext/session.rb

    r6342 r6733  
    1 # CGI::Session#create_new_id requires 'digest/md5' on every call.  This makes 
    2 # sense when spawning processes per request, but is unnecessarily expensive 
    3 # when serving requests from a long-lived process. 
    4 
    5 # http://railsexpress.de/blog/articles/2005/11/22/speeding-up-the-creation-of-new-sessions 
    6 
    7 # Also expose the CGI instance to session stores. 
     1require 'digest/md5' 
    82require 'cgi/session' 
    9 require 'digest/md5
     3require 'cgi/session/pstore
    104 
    11 class CGI 
     5class CGI #:nodoc: 
     6  # * Expose the CGI instance to session stores. 
     7  # * Don't require 'digest/md5' whenever a new session id is generated. 
    128  class Session #:nodoc: 
    139    # Generate an MD5 hash including the time, a random number, the process id, 
     
    4036        self.class.generate_unique_id 
    4137      end 
     38 
     39    # * Don't require 'digest/md5' whenever a new session is started. 
     40    class PStore #:nodoc: 
     41      def initialize(session, option={}) 
     42        dir = option['tmpdir'] || Dir::tmpdir 
     43        prefix = option['prefix'] || '' 
     44        id = session.session_id 
     45        md5 = Digest::MD5.hexdigest(id)[0,16] 
     46        path = dir+"/"+prefix+md5 
     47        path.untaint 
     48        if File::exist?(path) 
     49          @hash = nil 
     50        else 
     51          unless session.new_session 
     52            raise CGI::Session::NoSession, "uninitialized session" 
     53          end 
     54          @hash = {} 
     55        end 
     56        @p = ::PStore.new(path) 
     57        @p.transaction do |p| 
     58          File.chmod(0600, p.path) 
     59        end 
     60      end 
     61    end 
    4262  end 
    4363end 
  • trunk/actionpack/lib/action_controller/cgi_process.rb

    r6431 r6733  
    1 require 'action_controller/cgi_ext/cgi_ext' 
    2 require 'action_controller/cgi_ext/cookie_performance_fix' 
    3 require 'action_controller/cgi_ext/raw_post_data_fix' 
    4 require 'action_controller/cgi_ext/session_performance_fix' 
    5 require 'action_controller/cgi_ext/pstore_performance_fix' 
     1require 'action_controller/cgi_ext' 
    62require 'action_controller/session/cookie_store' 
    73 
     
    6561    def query_parameters 
    6662      @query_parameters ||= 
    67         (qs = self.query_string).empty? ? {} : CGIMethods.parse_query_parameters(qs) 
     63        (qs = self.query_string).empty? ? {} : CGI.parse_query_parameters(qs) 
    6864    end 
    6965 
     
    7167      @request_parameters ||= 
    7268        if ActionController::Base.param_parsers.has_key?(content_type) 
    73           CGIMethods.parse_formatted_request_parameters(content_type, @env['RAW_POST_DATA']) 
    74         else 
    75           CGIMethods.parse_request_parameters(@cgi.params) 
     69          CGI.parse_formatted_request_parameters(content_type, @env['RAW_POST_DATA']) 
     70        else 
     71          CGI.parse_request_parameters(@cgi.params) 
    7672        end 
    7773    end 
  • trunk/actionpack/test/controller/cgi_test.rb

    r6578 r6733  
    11require File.dirname(__FILE__) + '/../abstract_unit' 
    22require 'action_controller/cgi_process' 
    3 require 'action_controller/cgi_ext/cgi_ext' 
    4  
    5 require 'stringio' 
    63 
    74class CGITest < Test::Unit::TestCase 
     
    2320    assert_equal( 
    2421      { "action" => "create_customer", "full_name" => "David Heinemeier Hansson", "customerId" => "1"}, 
    25       CGIMethods.parse_query_parameters(@query_string) 
     22      CGI.parse_query_parameters(@query_string) 
    2623    ) 
    2724  end 
     
    2926  def test_deep_query_string 
    3027    expected = {'x' => {'y' => {'z' => '10'}}} 
    31     assert_equal(expected, CGIMethods.parse_query_parameters('x[y][z]=10')) 
     28    assert_equal(expected, CGI.parse_query_parameters('x[y][z]=10')) 
    3229  end 
    3330   
    3431  def test_deep_query_string_with_array 
    35     assert_equal({'x' => {'y' => {'z' => ['10']}}}, CGIMethods.parse_query_parameters('x[y][z][]=10')) 
    36     assert_equal({'x' => {'y' => {'z' => ['10', '5']}}}, CGIMethods.parse_query_parameters('x[y][z][]=10&x[y][z][]=5')) 
     32    assert_equal({'x' => {'y' => {'z' => ['10']}}}, CGI.parse_query_parameters('x[y][z][]=10')) 
     33    assert_equal({'x' => {'y' => {'z' => ['10', '5']}}}, CGI.parse_query_parameters('x[y][z][]=10&x[y][z][]=5')) 
    3734  end 
    3835 
    3936  def test_deep_query_string_with_array_of_hash 
    40     assert_equal({'x' => {'y' => [{'z' => '10'}]}}, CGIMethods.parse_query_parameters('x[y][][z]=10')) 
    41     assert_equal({'x' => {'y' => [{'z' => '10', 'w' => '10'}]}}, CGIMethods.parse_query_parameters('x[y][][z]=10&x[y][][w]=10')) 
     37    assert_equal({'x' => {'y' => [{'z' => '10'}]}}, CGI.parse_query_parameters('x[y][][z]=10')) 
     38    assert_equal({'x' => {'y' => [{'z' => '10', 'w' => '10'}]}}, CGI.parse_query_parameters('x[y][][z]=10&x[y][][w]=10')) 
    4239  end 
    4340 
    4441  def test_deep_query_string_with_array_of_hashes_with_one_pair 
    45     assert_equal({'x' => {'y' => [{'z' => '10'}, {'z' => '20'}]}}, CGIMethods.parse_query_parameters('x[y][][z]=10&x[y][][z]=20')) 
    46     assert_equal("10", CGIMethods.parse_query_parameters('x[y][][z]=10&x[y][][z]=20')["x"]["y"].first["z"]) 
    47     assert_equal("10", CGIMethods.parse_query_parameters('x[y][][z]=10&x[y][][z]=20').with_indifferent_access[:x][:y].first[:z]) 
     42    assert_equal({'x' => {'y' => [{'z' => '10'}, {'z' => '20'}]}}, CGI.parse_query_parameters('x[y][][z]=10&x[y][][z]=20')) 
     43    assert_equal("10", CGI.parse_query_parameters('x[y][][z]=10&x[y][][z]=20')["x"]["y"].first["z"]) 
     44    assert_equal("10", CGI.parse_query_parameters('x[y][][z]=10&x[y][][z]=20').with_indifferent_access[:x][:y].first[:z]) 
    4845  end 
    4946   
     
    5653    expected = { "note" => { "viewers"=>{"viewer"=>[{ "id"=>"1", "type"=>"User"}, {"type"=>"Group", "id"=>"2"} ]} } } 
    5754 
    58     assert_equal(expected, CGIMethods.parse_request_parameters(query)) 
     55    assert_equal(expected, CGI.parse_request_parameters(query)) 
    5956  end 
    6057   
     
    6259    assert_equal( 
    6360      {'x' => {'y' => [{'z' => '10', 'w' => 'a'}, {'z' => '20', 'w' => 'b'}]}},  
    64       CGIMethods.parse_query_parameters('x[y][][z]=10&x[y][][w]=a&x[y][][z]=20&x[y][][w]=b') 
     61      CGI.parse_query_parameters('x[y][][z]=10&x[y][][w]=a&x[y][][z]=20&x[y][][w]=b') 
    6562    ) 
    6663  end 
     
    6966    assert_equal( 
    7067      { "action" => "create_customer", "full_name" => ''}, 
    71       CGIMethods.parse_query_parameters(@query_string_with_empty) 
     68      CGI.parse_query_parameters(@query_string_with_empty) 
    7269    ) 
    7370  end 
     
    7673    assert_equal( 
    7774      { "action" => "create_customer", "selected" => ["1", "2", "3"]}, 
    78       CGIMethods.parse_query_parameters(@query_string_with_array) 
     75      CGI.parse_query_parameters(@query_string_with_array) 
    7976    ) 
    8077  end 
     
    8380    assert_equal( 
    8481      { "action" => "create_customer", "name" => "Don't & Does"}, 
    85       CGIMethods.parse_query_parameters(@query_string_with_amps) 
     82      CGI.parse_query_parameters(@query_string_with_amps) 
    8683    )     
    8784  end 
     
    9087    assert_equal( 
    9188      { "action" => "create_customer", "full_name" => "abc=def=ghi"}, 
    92       CGIMethods.parse_query_parameters(@query_string_with_many_equal) 
     89      CGI.parse_query_parameters(@query_string_with_many_equal) 
    9390    )     
    9491  end 
     
    9794    assert_equal( 
    9895      { "action" => nil }, 
    99       CGIMethods.parse_query_parameters(@query_string_without_equal) 
     96      CGI.parse_query_parameters(@query_string_without_equal) 
    10097    )     
    10198  end 
     
    104101    assert_equal( 
    105102      { "action" => "create_customer", "full_name" => "David Heinemeier Hansson" }, 
    106       CGIMethods.parse_query_parameters(@query_string_with_empty_key) 
     103      CGI.parse_query_parameters(@query_string_with_empty_key) 
    107104    ) 
    108105  end 
     
    111108    assert_equal( 
    112109      { "action" => "create_customer", "full_name" => "David Heinemeier Hansson"}, 
    113       CGIMethods.parse_query_parameters(@query_string_with_many_ampersands) 
     110      CGI.parse_query_parameters(@query_string_with_many_ampersands) 
    114111    ) 
    115112  end 
     
    151148    } 
    152149 
    153     assert_equal expected_output, CGIMethods.parse_request_parameters(input) 
     150    assert_equal expected_output, CGI.parse_request_parameters(input) 
    154151  end 
    155152   
     
    198195    } 
    199196 
    200     params = CGIMethods.parse_request_parameters(input) 
     197    params = CGI.parse_request_parameters(input) 
    201198    assert_equal expected_output, params 
    202199 
     
    229226    } 
    230227 
    231     assert_equal expected_output, CGIMethods.parse_request_parameters(input) 
     228    assert_equal expected_output, CGI.parse_request_parameters(input) 
    232229  end 
    233230 
     
    237234    expected_output = { "selected" => [ "1", "2", "3" ] } 
    238235 
    239     assert_equal expected_output, CGIMethods.parse_request_parameters(input) 
     236    assert_equal expected_output, CGI.parse_request_parameters(input) 
    240237  end 
    241238 
     
    243240    input     = { "a/b[c]" =>  %w(d) } 
    244241    expected  = { "a/b" => { "c" => "d" }} 
    245     assert_equal expected, CGIMethods.parse_request_parameters(input) 
     242    assert_equal expected, CGI.parse_request_parameters(input) 
    246243  end 
    247244 
     
    249246    input     = { "a/b[c]d" =>  %w(e) } 
    250247    expected  = { "a/b" => {} } 
    251     assert_equal expected, CGIMethods.parse_request_parameters(input) 
     248    assert_equal expected, CGI.parse_request_parameters(input) 
    252249  end 
    253250 
     
    255252    input     = { "a/b@[c]d[e]" =>  %w(f) } 
    256253    expected  = { "a/b@" => { }} 
    257     assert_equal expected, CGIMethods.parse_request_parameters(input) 
     254    assert_equal expected, CGI.parse_request_parameters(input) 
    258255  end 
    259256 
     
    261258    input     = { "a/b@[c]d[e][]" =>  %w(f) } 
    262259    expected  = { "a/b@" => { }} 
    263     assert_equal expected , CGIMethods.parse_request_parameters(input) 
     260    assert_equal expected , CGI.parse_request_parameters(input) 
    264261  end 
    265262 
     
    267264    input     = { "a/b@[c][d[e][]" =>  %w(f) } 
    268265    expected  = { "a/b@" => { "c" => { }}} 
    269     assert_equal expected, CGIMethods.parse_request_parameters(input) 
     266    assert_equal expected, CGI.parse_request_parameters(input) 
    270267  end 
    271268   
     
    273270    input = { nil => nil, "test2" => %w(value1) } 
    274271    expected = { "test2" => "value1" } 
    275     assert_equal expected, CGIMethods.parse_request_parameters(input) 
     272    assert_equal expected, CGI.parse_request_parameters(input) 
    276273  end 
    277274end 
     
    282279    raw_post_data =  
    283280      "<person><name>David</name><avatar type='file' name='me.jpg' content_type='image/jpg'>#{Base64.encode64('ABC')}</avatar></person>" 
    284     person = CGIMethods.parse_formatted_request_parameters(Mime::XML, raw_post_data) 
     281    person = CGI.parse_formatted_request_parameters(Mime::XML, raw_post_data) 
    285282    assert_equal "image/jpg", person['person']['avatar'].content_type 
    286283    assert_equal "me.jpg", person['person']['avatar'].original_filename 
     
    294291      "<avatar type='file' name='you.gif' content_type='image/gif'>#{Base64.encode64('DEF')}</avatar>" + 
    295292      "</avatars></person>" 
    296     person = CGIMethods.parse_formatted_request_parameters(Mime::XML, raw_post_data) 
     293    person = CGI.parse_formatted_request_parameters(Mime::XML, raw_post_data) 
    297294 
    298295    assert_equal "image/jpg", person['person']['avatars']['avatar'].first.content_type 
     
    388385        $stdin = file 
    389386        @cgi = CGI.new 
    390         CGIMethods.parse_request_parameters @cgi.params 
     387        CGI.parse_request_parameters @cgi.params 
    391388      end 
    392389    ensure 
     
    458455   assert_equal( 
    459456     {'location' => ["1", "2"], 'age_group' => ["2"]}, 
    460   CGIMethods.parse_query_parameters("location[]=1&location[]=2&age_group[]=2") 
     457  CGI.parse_query_parameters("location[]=1&location[]=2&age_group[]=2") 
    461458   ) 
    462459   assert_equal( 
    463460     {'location' => ["1", "2"], 'age_group' => ["2"]}, 
    464      CGIMethods.parse_request_parameters({'location[]' => ["1", "2"], 
     461     CGI.parse_request_parameters({'location[]' => ["1", "2"], 
    465462  'age_group[]' => ["2"]}) 
    466463   ) 
  • trunk/actionpack/test/controller/raw_post_test.rb

    r6057 r6733  
    11require "#{File.dirname(__FILE__)}/../abstract_unit" 
    2 require 'cgi' 
    32require 'stringio' 
    4 require 'action_controller/cgi_ext/raw_post_data_fix
     3require 'action_controller/cgi_ext/query_extension
    54 
    65class RawPostDataTest < Test::Unit::TestCase 
  • trunk/actionpack/test/controller/session/cookie_store_test.rb

    r6424 r6733  
    11require "#{File.dirname(__FILE__)}/../../abstract_unit" 
    22require 'action_controller/cgi_process' 
    3 require 'action_controller/cgi_ext/cgi_ext
     3require 'action_controller/cgi_ext
    44 
    55require 'stringio'