mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
Merge pull request #912 from sinatra/revert-897-master
Revert "Added PROPFIND verb support"
This commit is contained in:
commit
fc0c3300c2
2 changed files with 11 additions and 16 deletions
|
@ -53,7 +53,7 @@ module Sinatra
|
|||
end
|
||||
|
||||
def safe?
|
||||
get? or head? or options? or trace? or propfind?
|
||||
get? or head? or options? or trace?
|
||||
end
|
||||
|
||||
def idempotent?
|
||||
|
@ -68,10 +68,6 @@ module Sinatra
|
|||
request_method == "UNLINK"
|
||||
end
|
||||
|
||||
def propfind?
|
||||
request_method == "PROPFIND"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
class AcceptEntry
|
||||
|
@ -1377,15 +1373,14 @@ module Sinatra
|
|||
route('HEAD', path, opts, &block)
|
||||
end
|
||||
|
||||
def put(path, opts = {}, &bk) route 'PUT', 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 head(path, opts = {}, &bk) route 'HEAD', 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 link(path, opts = {}, &bk) route 'LINK', 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
|
||||
def put(path, opts = {}, &bk) route 'PUT', 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 head(path, opts = {}, &bk) route 'HEAD', 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 link(path, opts = {}, &bk) route 'LINK', path, opts, &bk end
|
||||
def unlink(path, opts = {}, &bk) route 'UNLINK', path, opts, &bk end
|
||||
|
||||
# Makes the methods defined in the block and in the Modules given
|
||||
# in `extensions` available to the handlers and templates
|
||||
|
@ -1998,7 +1993,7 @@ module Sinatra
|
|||
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,
|
||||
:set, :mime_type, :enable, :disable, :use, :development?, :test?,
|
||||
:production?, :helpers, :settings, :register
|
||||
|
|
|
@ -60,7 +60,7 @@ class DelegatorTest < Test::Unit::TestCase
|
|||
assert_equal Sinatra::Application, Sinatra::Delegator.target
|
||||
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
|
||||
delegation_app do
|
||||
send(verb, '/hello') { 'Hello World' }
|
||||
|
|
Loading…
Add table
Reference in a new issue