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

Changeset 7212

Show
Ignore:
Timestamp:
07/24/07 01:20:18 (1 year ago)
Author:
david
Message:

Fixed that file.content_type for uploaded files would include a trailing \r #9053 [bgreenlee]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r7197 r7212  
    11*SVN* 
     2 
     3* Fixed that file.content_type for uploaded files would include a trailing \r #9053 [bgreenlee] 
    24 
    35* url_for now accepts a series of symbols representing the namespace of the record [Josh Knowles] 
  • trunk/actionpack/lib/action_controller/request.rb

    r7126 r7212  
    543543            end 
    544544 
    545             /Content-Type: (.*)/ni.match(head) 
     545            /Content-Type: ([^\r]*)/ni.match(head) 
    546546            content_type = ($1 or "") 
    547547 
  • trunk/actionpack/test/controller/request_test.rb

    r7126 r7212  
    668668    assert_kind_of StringIO, file 
    669669    assert_equal 'file.txt', file.original_filename 
    670     assert_equal "text/plain\r", file.content_type 
     670    assert_equal "text/plain", file.content_type 
    671671    assert_equal 'contents', file.read 
    672672  end 
     
    680680    assert_kind_of Tempfile, file 
    681681    assert_equal 'file.txt', file.original_filename 
    682     assert_equal "text/plain\r", file.content_type 
     682    assert_equal "text/plain", file.content_type 
    683683    assert ('a' * 20480) == file.read 
    684684  end 
     
    698698    assert_kind_of StringIO, file 
    699699    assert_equal 'flowers.jpg', file.original_filename 
    700     assert_equal "image/jpeg\r", file.content_type 
     700    assert_equal "image/jpeg", file.content_type 
    701701    assert_equal 19512, file.size 
    702702    #assert_equal File.read(File.dirname(__FILE__) + '/../../../activerecord/test/fixtures/flowers.jpg'), file.read