aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/info_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/info_controller.rb')
-rw-r--r--railties/lib/rails/info_controller.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/railties/lib/rails/info_controller.rb b/railties/lib/rails/info_controller.rb
new file mode 100644
index 0000000000..196eeb4a6c
--- /dev/null
+++ b/railties/lib/rails/info_controller.rb
@@ -0,0 +1,15 @@
+class Rails::InfoController < ActionController::Base
+ def properties
+ if consider_all_requests_local? || local_request?
+ 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