It seems rack is making some unsafe assumptions about how much to slice off in:
# Save the rest.
if i = buf.index(rx)
body << buf.slice!(0, i)
buf.slice!(0, boundary_size+2)
content_length = -1 if $1 == "--"
end
change it to:
if i = buf.index(rx)
body << result = buf.slice!(0, i)
puts "result of first slice #{result}"
r2 = buf.slice!(0, boundary_size+2)
puts "result of second slice #{r2}"
content_length = -1 if $1 == "--"
end
And the debug output will show you that something is off...
> So I guess the only thing left to ask is.... when is the next gem
> release of rack? (which includes this fix)
It's time for 1.0 release candidates I think. Let's see what I can
get together this week. (Which version should they be?)
--
Christian Neukirchen <chneuk...@gmail.com> http://chneukirchen.org