lib/apipie/static_dispatcher.rb in apipie-rails-0.0.23 vs lib/apipie/static_dispatcher.rb in apipie-rails-0.0.24

- old
+ new

@@ -25,12 +25,21 @@ @file_server.call(env) end def ext @ext ||= begin - ext = ::ActionController::Base.page_cache_extension + ext = cache_extension "{,#{ext},/index#{ext}}" end + end + + def cache_extension + if ::ActionController::Base.respond_to?(:default_static_extension) + ::ActionController::Base.default_static_extension + else + ::ActionController::Base.page_cache_extension + end + end end class StaticDispatcher # Dispatches the static files. Similar to ActionDispatch::Static, but