diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2015-09-23 22:14:43 +0200 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2015-09-23 22:14:43 +0200 |
commit | 262f92364b8d3e4eddb490bcb8b31c0ca9b934f9 (patch) | |
tree | d06752659468e73a2defd19518c05bed07bf90cc /actionpack | |
parent | 5c30e86dc4ddf2d7f766a278fba2ab3057c1501f (diff) | |
parent | 619481559d6530153e6e5d7d67802f6838fe4a5e (diff) | |
download | rails-262f92364b8d3e4eddb490bcb8b31c0ca9b934f9.tar.gz rails-262f92364b8d3e4eddb490bcb8b31c0ca9b934f9.tar.bz2 rails-262f92364b8d3e4eddb490bcb8b31c0ca9b934f9.zip |
Merge pull request #21736 from eliotsykes/document-bearer-prefix
Document Bearer prefix for Authorization header [ci skip]
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/metal/http_authentication.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/metal/http_authentication.rb b/actionpack/lib/action_controller/metal/http_authentication.rb index 0ff5ceb728..fe470552b0 100644 --- a/actionpack/lib/action_controller/metal/http_authentication.rb +++ b/actionpack/lib/action_controller/metal/http_authentication.rb @@ -436,15 +436,17 @@ module ActionController end end - # Parses the token and options out of the token authorization header. If - # the header looks like this: + # Parses the token and options out of the token authorization header. + # The value for the Authorization header is expected to have the prefix + # <tt>"Token"</tt> or <tt>"Bearer"</tt>. If the header looks like this: # Authorization: Token token="abc", nonce="def" - # Then the returned token is "abc", and the options is {nonce: "def"} + # Then the returned token is <tt>"abc"</tt>, and the options are + # <tt>{nonce: "def"}</tt> # # request - ActionDispatch::Request instance with the current headers. # - # Returns an Array of [String, Hash] if a token is present. - # Returns nil if no token is found. + # Returns an +Array+ of <tt>[String, Hash]</tt> if a token is present. + # Returns +nil+ if no token is found. def token_and_options(request) authorization_request = request.authorization.to_s if authorization_request[TOKEN_REGEX] |