acme-plugin icon indicating copy to clipboard operation
acme-plugin copied to clipboard

rails 5.2.3 got "no route error" on /.well-known

Open JackiMode opened this issue 5 years ago • 2 comments

Please use markdown formatting for code, configuration or console output.

1. Expected behavior

2.6.1 :001 > r = Rails.application.routes
 => #<ActionDispatch::Routing::RouteSet:0x00005649b37e8a58>
2.6.1 :002 > r.recognize_path "/.well-known/acme-challenge/lyQnV4QydflZ6px3YqoaFQupRAOeew69SSMv27nBRkc"
 => {:controller=>"acme_plugin/application", :action=>"index", :challenge=>"lyQnV4QydflZ6px3YqoaFQupRAOeew69SSMv27nBRkc"}

2. Actual behavior

Loading production environment (Rails 5.2.3)
2.6.1 :001 > r = Rails.application.routes
 => #<ActionDispatch::Routing::RouteSet:0x00005637a8726a38>
2.6.1 :002 > r.recognize_path "/.well-known/acme-challenge/lyQnV4QydflZ6px3YqoaFQupRAOeew69SSMv27nBRkc"
Traceback (most recent call last):
        1: from (irb):2
ActionController::RoutingError (No route matches "/.well-known/acme-challenge/lyQnV4QydflZ6px3YqoaFQupRAOeew69SSMv27nBRkc")

3. Steps to reproduce issue

install gem rails 5.2.3

4. Your configuration (ruby, rails version, your Gemifile and Gemfile.lock files etc.)

rails 5.2.3, ruby 2.6.1

downgrading to rails 5.2.0 solves problem

JackiMode avatar Apr 25 '19 09:04 JackiMode

Am also seeing this on rails 5.2.3

rounders avatar May 23 '19 00:05 rounders

A workaround is to add the following route directly to your rails project:

get '.well-known/acme-challenge/:challenge' => 'acme_plugin/application#index'

For some reason any route that start with a period doesn't get picked up correctly when defined in a rails engine at the moment but they still work fine when added directly to your project routes.rb file.

rounders avatar May 23 '19 19:05 rounders