Revision af98b7e1
Added by Dmitri Dolguikh almost 11 years ago
- ID af98b7e1b617dfc68ed9c0cf54dbd10ae15c7ca5
Gemfile | ||
---|---|---|
source 'http://rubygems.org'
|
||
|
||
gem 'json'
|
||
gem 'sinatra'
|
||
gem 'sinatra', '< 1.4.3'
|
||
|
||
Dir["#{File.dirname(__FILE__)}/bundler.d/*.rb"].each do |bundle|
|
||
# puts "adding custom gem file #{bundle}"
|
lib/sinatra-patch.rb | ||
---|---|---|
require "openssl"
|
||
require "webrick/https"
|
||
require "daemon" unless PLATFORM =~/mingw/
|
||
|
||
module Sinatra
|
||
class Base
|
||
# Run the Sinatra app as a self-hosted server using
|
||
... | ... | |
module MonkeyRequest
|
||
# We need request.accept? method also in pre-1.3.0 versions. This is simplified
|
||
# version of the method that only accept one parameter (mime type string).
|
||
def accept? type
|
||
def accept?(type)
|
||
accept.include? type
|
||
end
|
||
end
|
||
Request.send :include, MonkeyRequest if not Request.method_defined? :accept?
|
||
Request.send :include, MonkeyRequest unless Request.method_defined?(:accept?)
|
||
end
|
test/test_helper.rb | ||
---|---|---|
require "mocha/setup"
|
||
require "rack/test"
|
||
require 'sinatra'
|
||
require 'sinatra-patch'
|
Also available in: Unified diff
fixes #2673 - none/wildcard http 'accept' headers are being handled correctly now
(cherry picked from commit c164bdd6e754a32d1923340bb9336c649ef8390a)