mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Added ActionDispatch::Request#authorization to access the http authentication header regardless of its proxy hiding [DHH]
This commit is contained in:
parent
36c13cc07a
commit
cf9d6a95e8
2 changed files with 11 additions and 0 deletions
|
@ -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'
|
||||
|
|
|
@ -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.
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue