Froze rails gems
[depot.git] / vendor / rails / actionpack / lib / action_controller / cgi_ext / query_extension.rb
1 require 'cgi'
2
3 class CGI #:nodoc:
4 module QueryExtension
5 # Remove the old initialize_query method before redefining it.
6 remove_method :initialize_query
7
8 # Neuter CGI parameter parsing.
9 def initialize_query
10 # Fix some strange request environments.
11 env_table['REQUEST_METHOD'] ||= 'GET'
12
13 # POST assumes missing Content-Type is application/x-www-form-urlencoded.
14 if env_table['CONTENT_TYPE'].blank? && env_table['REQUEST_METHOD'] == 'POST'
15 env_table['CONTENT_TYPE'] = 'application/x-www-form-urlencoded'
16 end
17
18 @cookies = CGI::Cookie::parse(env_table['HTTP_COOKIE'] || env_table['COOKIE'])
19 @params = {}
20 end
21 end
22 end