Created
October 16, 2009 00:34
-
-
Save vadims/211431 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
Sinatra::Default.set :run, false | |
Sinatra::Default.set :environment, ENV['RACK_ENV'] | |
require 'test' | |
run Sinatra::Application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
post '/' do | |
params['test'][:type] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ruby -e "puts 'a' * 20000" > short | |
ruby -e "puts 'a' * 1000000" > long | |
# everything works fine without unicorn | |
ruby test.rb -p 8080 & | |
sleep 5 | |
curl -v -F test=@short localhost:8080 | |
curl -v -F test=@long localhost:8080 | |
kill -9 $! | |
# the short test works, the long one doesn't | |
# EOFError: bad content body | |
# /Users/vadim/.gem/ruby/1.8/gems/rack-1.0.0/lib/rack/utils.rb:347:in `parse_multipart' | |
# /Users/vadim/.gem/ruby/1.8/gems/rack-1.0.0/lib/rack/utils.rb:319:in `loop' | |
# /Users/vadim/.gem/ruby/1.8/gems/rack-1.0.0/lib/rack/utils.rb:319:in `parse_multipart' | |
unicorn & | |
sleep 5 | |
curl -v -F test=@short localhost:8080 | |
curl -v -F test=@long localhost:8080 | |
kill -9 $! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment