diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2010-11-02 10:47:32 +0000 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2010-11-02 10:56:14 +0000 |
commit | d446392f76c063d9f04396a1d3ca9e314a521671 (patch) | |
tree | 55cebc9098b86d92f7c731d35369790aad6e2264 /actionpack/lib/action_dispatch/routing | |
parent | 18b6aa65389cd10d62dc0005e632a3a2d474dec4 (diff) | |
download | rails-d446392f76c063d9f04396a1d3ca9e314a521671.tar.gz rails-d446392f76c063d9f04396a1d3ca9e314a521671.tar.bz2 rails-d446392f76c063d9f04396a1d3ca9e314a521671.zip |
Add additional HTTP request methods from the following RFCs:
* Hypertext Transfer Protocol -- HTTP/1.1
http://www.ietf.org/rfc/rfc2616.txt)
* HTTP Extensions for Distributed Authoring -- WEBDAV
http://www.ietf.org/rfc/rfc2518.txt
* Versioning Extensions to WebDAV
http://www.ietf.org/rfc/rfc3253.txt
* Ordered Collections Protocol (WebDAV)
http://www.ietf.org/rfc/rfc3648.txt
* Web Distributed Authoring and Versioning (WebDAV) Access Control Protocol
http://www.ietf.org/rfc/rfc3744.txt
* Web Distributed Authoring and Versioning (WebDAV) SEARCH
http://www.ietf.org/rfc/rfc5323.txt
* PATCH Method for HTTP
http://www.ietf.org/rfc/rfc5789.txt
[#2809 state:resolved] [#5895 state:resolved]
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 3c7dcea003..1bbb4f1f92 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1,6 +1,7 @@ require 'erb' require 'active_support/core_ext/hash/except' require 'active_support/core_ext/object/blank' +require 'active_support/inflector' module ActionDispatch module Routing @@ -186,8 +187,8 @@ module ActionDispatch def request_method_condition if via = @options[:via] - via = Array(via).map { |m| m.to_s.upcase } - { :request_method => Regexp.union(*via) } + via = Array(via).map { |m| m.to_s.dasherize.upcase } + { :request_method => %r[^#{via.join('|')}$] } else { } end |