aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-03-06 22:20:53 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-03-10 10:15:35 -0300
commitec40f6cec082cfe76f24b27c19d15314f55be8af (patch)
treebd7ad3e5beaf5eaba87451d8ae71b4e3b51573fc /railties/lib
parent6b28c94e20800e6be10b4f7dadff55c3c55f44ce (diff)
downloadrails-ec40f6cec082cfe76f24b27c19d15314f55be8af.tar.gz
rails-ec40f6cec082cfe76f24b27c19d15314f55be8af.tar.bz2
rails-ec40f6cec082cfe76f24b27c19d15314f55be8af.zip
Change api_only to http_only
[Carlos Antonio da Silva & Santiago Pastorino]
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/application.rb8
-rw-r--r--railties/lib/rails/configuration.rb12
2 files changed, 10 insertions, 10 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index 10fa63c303..3191fe68a7 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -239,7 +239,7 @@ module Rails
middleware.use ::Rack::Lock unless config.allow_concurrency
middleware.use ::Rack::Runtime
- middleware.use ::Rack::MethodOverride unless config.middleware.api_only?
+ middleware.use ::Rack::MethodOverride unless config.middleware.http_only?
middleware.use ::ActionDispatch::RequestId
middleware.use ::Rails::Rack::Logger, config.log_tags # must come after Rack::MethodOverride to properly log overridden methods
middleware.use ::ActionDispatch::ShowExceptions, config.exceptions_app || ActionDispatch::PublicExceptions.new(Rails.public_path)
@@ -252,9 +252,9 @@ module Rails
end
middleware.use ::ActionDispatch::Callbacks
- middleware.use ::ActionDispatch::Cookies unless config.middleware.api_only?
+ middleware.use ::ActionDispatch::Cookies unless config.middleware.http_only?
- if !config.middleware.api_only? && config.session_store
+ if !config.middleware.http_only? && config.session_store
if config.force_ssl && !config.session_options.key?(:secure)
config.session_options[:secure] = true
end
@@ -267,7 +267,7 @@ module Rails
middleware.use ::Rack::ConditionalGet
middleware.use ::Rack::ETag, "no-cache"
- if !config.middleware.api_only? && config.action_dispatch.best_standards_support
+ if !config.middleware.http_only? && config.action_dispatch.best_standards_support
middleware.use ::ActionDispatch::BestStandardsSupport, config.action_dispatch.best_standards_support
end
end
diff --git a/railties/lib/rails/configuration.rb b/railties/lib/rails/configuration.rb
index d3032bb8dd..d8185bcb34 100644
--- a/railties/lib/rails/configuration.rb
+++ b/railties/lib/rails/configuration.rb
@@ -37,7 +37,7 @@ module Rails
# going to be used as an API endpoint only, the middleware stack can be
# configured like this:
#
- # config.middleware.api_only!
+ # config.middleware.http_only!
#
# By doing this, Rails will create a smaller middleware stack, by not adding
# some middlewares that are usually useful for browser access only, such as
@@ -46,14 +46,14 @@ module Rails
class MiddlewareStackProxy
def initialize
@operations = []
- @api_only = false
+ @http_only = false
end
- attr_reader :api_only
- alias :api_only? :api_only
+ attr_reader :http_only
+ alias :http_only? :http_only
- def api_only!
- @api_only = true
+ def http_only!
+ @http_only = true
end
def insert_before(*args, &block)