aboutsummaryrefslogblamecommitdiffstats
path: root/railties/lib/rails/info_controller.rb
blob: 6b4bdb2921374d37128d3d0252b0acada3f1f09d (plain) (tree)
1
2
3
4
5
6
7
8

                                                    
                                                     

                                           
                                                                                                                                  

       





                                                        
   
class Rails::InfoController < ActionController::Base
  def properties
    if consider_all_requests_local? || request.local?
      render :inline => Rails::Info.to_html
    else
      render :text => '<p>For security purposes, this information is only available to local requests.</p>', :status => :forbidden
    end
  end

  protected

  def consider_all_requests_local?
    Rails.application.config.consider_all_requests_local
  end
end