diff options
author | José Valim <jose.valim@gmail.com> | 2009-12-21 11:21:27 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-12-21 11:21:27 +0100 |
commit | 5f34421c77b4cd873baadbbca877a93de5a4d602 (patch) | |
tree | 8182bb1c53864ab06079e14116a61d66e9617f7d /actionpack/lib/action_dispatch/http/request.rb | |
parent | cf7b94c013d4e824433a018001474e71ddd81a99 (diff) | |
parent | f09ad263cabe2e781c1994b85375fee8deba4317 (diff) | |
download | rails-5f34421c77b4cd873baadbbca877a93de5a4d602.tar.gz rails-5f34421c77b4cd873baadbbca877a93de5a4d602.tar.bz2 rails-5f34421c77b4cd873baadbbca877a93de5a4d602.zip |
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'actionpack/lib/action_dispatch/http/request.rb')
-rwxr-xr-x | actionpack/lib/action_dispatch/http/request.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index 6a52854961..bc17cadb38 100755 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -6,6 +6,7 @@ require 'active_support/memoizable' require 'active_support/core_ext/array/wrap' require 'active_support/core_ext/hash/indifferent_access' require 'active_support/core_ext/string/access' +require 'action_dispatch/http/headers' module ActionDispatch class Request < Rack::Request @@ -117,7 +118,7 @@ module ActionDispatch end end end - + def if_modified_since if since = env['HTTP_IF_MODIFIED_SINCE'] Time.rfc2822(since) rescue nil @@ -464,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. # |