aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_controller.rb2
-rw-r--r--actionpack/lib/action_controller/base.rb2
-rw-r--r--actionpack/lib/action_controller/metal/renderers.rb (renamed from actionpack/lib/action_controller/metal/render_options.rb)7
-rwxr-xr-xactionpack/lib/action_dispatch/http/request.rb9
5 files changed, 16 insertions, 6 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index 3852dfe02b..782b4229fb 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*Edge*
+* Added ActionDispatch::Request#authorization to access the http authentication header regardless of its proxy hiding [DHH]
+
* Added :alert, :notice, and :flash as options to ActionController::Base#redirect_to that'll automatically set the proper flash before the redirection [DHH]. Examples:
flash[:notice] = 'Post was created'
diff --git a/actionpack/lib/action_controller.rb b/actionpack/lib/action_controller.rb
index 029887c96e..e31b795cd2 100644
--- a/actionpack/lib/action_controller.rb
+++ b/actionpack/lib/action_controller.rb
@@ -26,7 +26,7 @@ module ActionController
autoload :Compatibility
autoload :Redirecting
autoload :Rendering
- autoload :RenderOptions
+ autoload :Renderers
autoload :Rescue
autoload :Responder
autoload :SessionManagement
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 6eda653cb2..e6cde7fd35 100644
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -10,7 +10,7 @@ module ActionController
include ActionController::UrlFor
include ActionController::Redirecting
include ActionController::Rendering
- include ActionController::RenderOptions::All
+ include ActionController::Renderers::All
include ActionController::Layouts
include ActionController::ConditionalGet
include ActionController::RackDelegation
diff --git a/actionpack/lib/action_controller/metal/render_options.rb b/actionpack/lib/action_controller/metal/renderers.rb
index b6a7ca0eda..c1ba47927a 100644
--- a/actionpack/lib/action_controller/metal/render_options.rb
+++ b/actionpack/lib/action_controller/metal/renderers.rb
@@ -1,10 +1,9 @@
module ActionController
-
def self.add_renderer(key, &block)
- RenderOptions.add(key, &block)
+ Renderers.add(key, &block)
end
- module RenderOptions
+ module Renderers
extend ActiveSupport::Concern
included do
@@ -52,7 +51,7 @@ module ActionController
module All
extend ActiveSupport::Concern
- include RenderOptions
+ include Renderers
INCLUDED = []
included do
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb
index 7d1f5a4504..bc17cadb38 100755
--- a/actionpack/lib/action_dispatch/http/request.rb
+++ b/actionpack/lib/action_dispatch/http/request.rb
@@ -465,6 +465,15 @@ EOM
session['flash'] || {}
end
+ # Returns the authorization header regardless of whether it was specified directly or through one of the
+ # proxy alternatives.
+ def authorization
+ @env['HTTP_AUTHORIZATION'] ||
+ @env['X-HTTP_AUTHORIZATION'] ||
+ @env['X_HTTP_AUTHORIZATION'] ||
+ @env['REDIRECT_X_HTTP_AUTHORIZATION']
+ end
+
# Receives an array of mimes and return the first user sent mime that
# matches the order array.
#