The Static event handler is now instantiated with a reference back to the Sinatra app instead of using the global singleton. While here, bump streaming buffer size from 4K to 8K -- word around the campfire is that reading in 8K chunks results in a bit less IO on most modern systems.
This is the same (byte-for-byte) handler that's included with Rack 0.4 which we've required since 0.3.
The default :stream option value was not being picked up properly leading all calls to send_file (including those served with Static) to read the entire file into a string before sending. Further, the body was then being returned as a string, which causes Rack to iterate over the contents line-wise.
Fix based on Collin's work here: http://sinatra.lighthouseapp.com/projects/9779/tickets/39-file-upload-matching-mp3-causes-silent-failure http://gist.github.com/3261
require 'sinatra/test/rspec' instead of 'sinatra/test/spec' to use.
The following methods were removed. All code that used them now uses Rack::Utils's escape methods directly: * Hash#from_params * Hash#to_params * Hash#symbolize_keys (not used) * Hash#pass (not used)
Use Rack::Util's unescape instead.
Only forward if the response object responds to the given message. This makes exceptions a bit easier to track down.
Man. These tests kind of suck. Someone needs to organize this shit semi-logically.
Execute the before filters before looking up the event. Makes it possible for filters to rewrite request variables such as PATH_INFO and REQUEST_METHOD and have it effect which route is chosen.
The raise_errors option was implemented as part of the default error handler making it worthless in development mode or with a custom error handler. This moves the implementation to the core dispatch method. While here, clean up the Error class a bit, making it use the options provided and pass the correct HTTP status code.
Fixes case where development error handlers show up in non-development environments when the env option is set in code instead of on the command line. For example, the following app shows the development 404 page: require 'sinatra' set :env, :production
I can't stand this shit anymore.
Use Rack gem instead of freezing.
This fixes the problem when running an app with -e development
…ts via 'set :server, handler' if Rack::Handler::Thing doesn't exist. This lets special capitalziation cases like FastCGI, CGI, and WEBrick be handled easily.
…h is code for 'all of them'