Fix data corruption with small uploads via browsers
commitd9c97a2e04e0455e2d2aa3e5ec6439c3b97a1b7c
authorEric Wong <normalperson@yhbt.net>
Fri, 24 Apr 2009 01:35:26 +0000 (23 18:35 -0700)
committerEric Wong <normalperson@yhbt.net>
Fri, 24 Apr 2009 01:35:26 +0000 (23 18:35 -0700)
tree247f773e33b151d1252a33d37cbb24276a0f4634
parentcfece4194f18aa2f93d372a6030f15990f5fe891
Fix data corruption with small uploads via browsers

StringIO.new(partial_body) does not update the offset for new
writes.  So instead create the StringIO object and then syswrite
to it and try to follow the same code path used by large uploads
which use Tempfiles.
lib/unicorn/http_request.rb
test/unit/test_upload.rb