Changeset 6340
- Timestamp:
- 03/05/07 18:24:17 (2 years ago)
- Files:
-
- trunk/actionpack/lib/action_controller/request.rb (modified) (1 diff)
- trunk/actionpack/test/controller/request_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/lib/action_controller/request.rb
r6317 r6340 59 59 @content_type ||= 60 60 begin 61 content_type = @env['CONTENT_TYPE'].to_s.downcase 61 # Receive header sans any charset information. 62 content_type = @env['CONTENT_TYPE'].to_s.sub(/\s*\;.*$/, '').strip.downcase 62 63 63 64 if x_post_format = @env['HTTP_X_POST_DATA_FORMAT'] trunk/actionpack/test/controller/request_test.rb
r5912 r6340 324 324 assert_equal Mime::JS, @request.format 325 325 end 326 327 def test_content_type 328 @request.env["CONTENT_TYPE"] = "text/html" 329 assert_equal Mime::HTML, @request.content_type 330 end 331 332 def test_content_no_type 333 assert_equal nil, @request.content_type 334 end 335 336 def test_content_type_xml 337 @request.env["CONTENT_TYPE"] = "application/xml" 338 assert_equal Mime::XML, @request.content_type 339 end 340 341 def test_content_type_with_charset 342 @request.env["CONTENT_TYPE"] = "application/xml; charset=UTF-8" 343 assert_equal Mime::XML, @request.content_type 344 end 326 345 327 346 protected