ruby-on-railsgitactiondispatch

undefined method `propfind' for ActionDispatch::Routing::Mapper


I am trying to implement git push on my rails app and it sends PROPFIND request which rails doesn't seem to validate. When I try:

git push http://localhost:3000/satellite/.git

it gives me:

Started PROPFIND "/satellite/.git/" for 127.0.0.1 at 2015-06-08 19:20:38 +0530

ActionController::RoutingError (No route matches [PROPFIND] "/satellite/.git")

however git clone http://localhost:3000/satellite/.git works just fine. (ie repo exists there.)

If I try to add propfind to my routes.rb file it gives me:

undefined method `propfind' for ActionDispatch::Routing::Mapper

I found this: https://rails.lighthouseapp.com/projects/8994/tickets/5895-allow-mounting-of-rack-apps-that-deal-with-http-extensions

I think after that patch they allowed PROPFIND in ActionDispatch, and in doc they have mentioned propfind as RFC3253 constant.Is there any way I can enable PROPFIND?


Solution

  • It would appear that you have to add PROPFIND requests to your routes via a generic matcher, (see this test), so the following should work for you:

    resources :git_repos do
      member do
        match '.git' => :your_route, :via => :propfind
      end
    end