diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2009-12-20 18:30:50 -0800 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2009-12-20 18:30:50 -0800 |
commit | cf9d6a95e805bdddfa9c6b541631d51b3165bf23 (patch) | |
tree | 433e1fbf194c8c7dfbb33fd70cd87d6894108027 /actionpack/lib/action_dispatch/http | |
parent | 36c13cc07a45cbfa5d06c89001a092c70b07e253 (diff) | |
download | rails-cf9d6a95e805bdddfa9c6b541631d51b3165bf23.tar.gz rails-cf9d6a95e805bdddfa9c6b541631d51b3165bf23.tar.bz2 rails-cf9d6a95e805bdddfa9c6b541631d51b3165bf23.zip |
Added ActionDispatch::Request#authorization to access the http authentication header regardless of its proxy hiding [DHH]
Diffstat (limited to 'actionpack/lib/action_dispatch/http')
-rwxr-xr-x | actionpack/lib/action_dispatch/http/request.rb | 9 |
1 files changed, 9 insertions, 0 deletions
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. # |