This project is archived and is in readonly mode.

#2809 ✓resolved
Rick DeNatale

[PATCH] Allowed controlled addition of new http methods

Reported by Rick DeNatale | June 16th, 2009 @ 09:41 PM | in 3.x

Certain IETF RFCs such as WebDav (RFC 4918) or CalDav (RFC 4791) extend the HTTP protocol by adding additional methods.

In order to support these APIs with a Rails based server it is necessary to extend Rails to recognize these additional http methods. To date this has required 'monkey patching' rails.

For example there is a railsdav plugin

Another example can be found here

It is interesting to note that these actually patch different aspects of Rails and neither covers the need completely.

The current Rails code base defines three different globals which contain an array of valid http method names. One place is in the Routing code, which determines which methods may be used in the :conditions=>:method option in building routes, and which methods can affect route recogition. There is another list in ActionDispatch::Request.
Rails 2.3 introduced a third in the Rack middleware which processes method overrides in post requests.

This makes the job of patching rails to implement a protocol with additional methods error prone.

This patch consolidates the three globals and introduces methods on the ActionController::Routes module for accessing, adding to, and removing from (the last primarily for tests) allowable http methods.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>


Referenced by