Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[PATCH] Allowed controlled addition of new http methods

#2809

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
http://github.com/stueccles/railsdav/tree/master

Another example can be found here http://rails.learnhub.com/lesson/2318-dealing-with-microsoft-office...

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.

Reported by Rick DeNatale · June 16th, 2009 @ 09:41 PM

State: resolved
Milestone: 3.x
Assigned to: Andrew White Andrew White
Importance: Low

Activity

  1. Tony Amoyal
    Tony Amoyal

    Thank you for this! When will this patch be applied to the Rails core?

    December 17th, 2009 @ 08:44 PM

  2. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  3. Dan Pickett
    Dan Pickett
    • Tag changed from dispatching, patch, routing, webcal, webdav to bugmash, dispatching, patch, routing, webcal, webdav

    May 9th, 2010 @ 07:05 PM

  4. Andrew White
    Andrew White
    • Assigned user set to Andrew White
    • State changed from new to needs-more-info
    • Importance changed from to Low

    Routing has completely changed in 3.0, so the patch is out of date. You can specify any HTTP method using the :via option to a route. Does this provide the functionality that you need?

    June 28th, 2010 @ 10:02 AM

  5. Repository
    Repository
    • State changed from needs-more-info to resolved

    (from [6c8982fa137421eebdc55560d5ebd52703b65c65]) Add additional HTTP request methods from the following RFCs:

    [#2809 [PATCH] Allowed controlled addition of new http methods state:resolved] [#5895 Allow mounting of rack apps that deal with HTTP extensions state:resolved] http://github.com/rails/rails/commit/6c8982fa137421eebdc55560d5ebd5...

    November 2nd, 2010 @ 11:09 AM

  6. Repository
    Repository

    (from [d446392f76c063d9f04396a1d3ca9e314a521671]) Add additional HTTP request methods from the following RFCs:

    [#2809 [PATCH] Allowed controlled addition of new http methods state:resolved] [#5895 Allow mounting of rack apps that deal with HTTP extensions state:resolved] http://github.com/rails/rails/commit/d446392f76c063d9f04396a1d3ca9e...

    November 2nd, 2010 @ 11:09 AM