Revert "Added PROPFIND verb support"
This commit is contained in:
parent
a43ba2c65a
commit
28af01e6af
|
@ -53,7 +53,7 @@ module Sinatra
|
||||||
end
|
end
|
||||||
|
|
||||||
def safe?
|
def safe?
|
||||||
get? or head? or options? or trace? or propfind?
|
get? or head? or options? or trace?
|
||||||
end
|
end
|
||||||
|
|
||||||
def idempotent?
|
def idempotent?
|
||||||
|
@ -68,10 +68,6 @@ module Sinatra
|
||||||
request_method == "UNLINK"
|
request_method == "UNLINK"
|
||||||
end
|
end
|
||||||
|
|
||||||
def propfind?
|
|
||||||
request_method == "PROPFIND"
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
class AcceptEntry
|
class AcceptEntry
|
||||||
|
@ -1377,15 +1373,14 @@ module Sinatra
|
||||||
route('HEAD', path, opts, &block)
|
route('HEAD', path, opts, &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
def put(path, opts = {}, &bk) route 'PUT', path, opts, &bk end
|
def put(path, opts = {}, &bk) route 'PUT', path, opts, &bk end
|
||||||
def post(path, opts = {}, &bk) route 'POST', path, opts, &bk end
|
def post(path, opts = {}, &bk) route 'POST', path, opts, &bk end
|
||||||
def delete(path, opts = {}, &bk) route 'DELETE', path, opts, &bk end
|
def delete(path, opts = {}, &bk) route 'DELETE', path, opts, &bk end
|
||||||
def head(path, opts = {}, &bk) route 'HEAD', path, opts, &bk end
|
def head(path, opts = {}, &bk) route 'HEAD', path, opts, &bk end
|
||||||
def options(path, opts = {}, &bk) route 'OPTIONS', path, opts, &bk end
|
def options(path, opts = {}, &bk) route 'OPTIONS', path, opts, &bk end
|
||||||
def patch(path, opts = {}, &bk) route 'PATCH', path, opts, &bk end
|
def patch(path, opts = {}, &bk) route 'PATCH', path, opts, &bk end
|
||||||
def link(path, opts = {}, &bk) route 'LINK', path, opts, &bk end
|
def link(path, opts = {}, &bk) route 'LINK', path, opts, &bk end
|
||||||
def unlink(path, opts = {}, &bk) route 'UNLINK', path, opts, &bk end
|
def unlink(path, opts = {}, &bk) route 'UNLINK', path, opts, &bk end
|
||||||
def propfind(path, opts = {}, &bk) route 'PROPFIND', path, opts, &bk end
|
|
||||||
|
|
||||||
# Makes the methods defined in the block and in the Modules given
|
# Makes the methods defined in the block and in the Modules given
|
||||||
# in `extensions` available to the handlers and templates
|
# in `extensions` available to the handlers and templates
|
||||||
|
@ -1998,7 +1993,7 @@ module Sinatra
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
delegate :get, :patch, :put, :post, :delete, :head, :options, :link, :unlink, :propfind,
|
delegate :get, :patch, :put, :post, :delete, :head, :options, :link, :unlink,
|
||||||
:template, :layout, :before, :after, :error, :not_found, :configure,
|
:template, :layout, :before, :after, :error, :not_found, :configure,
|
||||||
:set, :mime_type, :enable, :disable, :use, :development?, :test?,
|
:set, :mime_type, :enable, :disable, :use, :development?, :test?,
|
||||||
:production?, :helpers, :settings, :register
|
:production?, :helpers, :settings, :register
|
||||||
|
|
|
@ -60,7 +60,7 @@ class DelegatorTest < Test::Unit::TestCase
|
||||||
assert_equal Sinatra::Application, Sinatra::Delegator.target
|
assert_equal Sinatra::Application, Sinatra::Delegator.target
|
||||||
end
|
end
|
||||||
|
|
||||||
%w[get put post delete options patch link unlink propfind].each do |verb|
|
%w[get put post delete options patch link unlink].each do |verb|
|
||||||
it "delegates #{verb} correctly" do
|
it "delegates #{verb} correctly" do
|
||||||
delegation_app do
|
delegation_app do
|
||||||
send(verb, '/hello') { 'Hello World' }
|
send(verb, '/hello') { 'Hello World' }
|
||||||
|
|
Loading…
Reference in New Issue