Changeset 7126
- Timestamp:
- 06/26/07 01:19:18 (1 year ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/request.rb (modified) (4 diffs)
- trunk/actionpack/test/controller/request_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r7096 r7126 1 1 *SVN* 2 3 * Give the legacy X-POST_DATA_FORMAT header greater precedence during params parsing for backward compatibility. [Jeremy Kemper] 2 4 3 5 * Fixed that link_to with an href of # when using :method will not allow for click-through without JavaScript #7037 [stevenbristol/josh] trunk/actionpack/lib/action_controller/request.rb
r7005 r7126 69 69 # X-Post-Data-Format HTTP header if present. 70 70 def content_type 71 @content_type ||= 72 content_type_from_legacy_post_data_format_header || 73 Mime::Type.lookup(content_type_without_parameters) 71 @content_type ||= Mime::Type.lookup(content_type_without_parameters) 74 72 end 75 73 … … 297 295 # The raw content type string. Use when you need parameters such as 298 296 # charset or boundary which aren't included in the content_type MIME type. 297 # Overridden by the X-POST_DATA_FORMAT header for backward compatibility. 299 298 def content_type_with_parameters 300 env['CONTENT_TYPE'].to_s 299 content_type_from_legacy_post_data_format_header || 300 env['CONTENT_TYPE'].to_s 301 301 end 302 302 … … 310 310 if x_post_format = @env['HTTP_X_POST_DATA_FORMAT'] 311 311 case x_post_format.to_s.downcase 312 when 'yaml'; Mime::YAML313 when 'xml'; Mime::XML312 when 'yaml'; 'application/x-yaml' 313 when 'xml'; 'application/xml' 314 314 end 315 315 end … … 320 320 321 321 content_type, boundary = self.class.extract_multipart_boundary(content_type_with_parameters) 322 323 # Don't parse params for unknown requests. 322 324 return {} if content_type.blank? 323 325 trunk/actionpack/test/controller/request_test.rb
r7005 r7126 759 759 end 760 760 end 761 762 class LegacyXmlParamsParsingTest < XmlParamsParsingTest 763 private 764 def parse_body(body) 765 env = { 'HTTP_X_POST_DATA_FORMAT' => 'xml', 766 'CONTENT_LENGTH' => body.size.to_s } 767 cgi = ActionController::Integration::Session::MockCGI.new(env, body) 768 ActionController::CgiRequest.new(cgi).request_parameters 769 end 770 end