POST multipart-mime data will be truncated by 
Rack::Utils::Multipart.parse_multipart under some circumstances
-------------------------------------------------------------------------------------------------------------

                 Key: JRUBY-4579
                 URL: http://jira.codehaus.org/browse/JRUBY-4579
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.4
         Environment: jruby-1.4, rails-2.3.5, warbler-0.9.14, rack-1.0.1
            Reporter: Peter Ehrenberg
            Assignee: Thomas E Enebo
         Attachments: test_post.rb

Uploading files beteen 16K and 65k using POST multipart-mime data will be 
truncated to ~16K if deployed via war file.

To reproduce:

1. setup a plain rails app: rails test_post; cd test_post
2. setup warbler: jruby -S warble config
3. create metal file: see attachment file
4. create war file: jruby -S warble war
5. deploy to your servlet container: sudo cp test_post.war 
/PATH_TO_YOUR_WEBAPPS_DIR/webapps
6. create test files: ruby -e print 'x'*20000 >20k; ruby -e print 'x'*200000 
>200k;
7. curl: curl -F uplo...@20k http://localhost:8080/test_post/test_post

Posting 20k you get:

parsed size: 16279 # TRUNCATED! SHOULD BE 20000
raw size: 200197

Posting 200k:

parsed size: 200000 # WORKS
raw size 200198

You will see the same truncation if using a controller (instead metal).

I've tested this for tomcat 6.0.24 and jetty seeing the truncation. 

But running script/server (both mri and jruby) works fine even using same 
rack-1.0.1 as warbler version.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to