acme-plugin
acme-plugin copied to clipboard
rails 5.2.3 got "no route error" on /.well-known
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
Am also seeing this on rails 5.2.3
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.