Update OP::Authentication to use uppercase headers

Signed-off-by: Alex Coles <alex@alexbcoles.com>
pull/3220/head
Alex Coles 9 years ago
parent a47207b510
commit 69aaa74e5f
  1. 2
      lib/open_project/authentication.rb
  2. 2
      spec/controllers/api/v2/authentication_spec.rb

@ -83,7 +83,7 @@ module OpenProject
module_function
def pick_auth_scheme(supported_schemes, default_scheme, request_headers = {})
req_scheme = request_headers['X-Authentication-Scheme']
req_scheme = request_headers['HTTP_X_AUTHENTICATION_SCHEME']
if supported_schemes.include? req_scheme
req_scheme

@ -120,7 +120,7 @@ describe Api::V2::AuthenticationController, type: :controller do
context 'with Session auth scheme requested' do
before do
request.env['X-Authentication-Scheme'] = 'Session'
request.env['HTTP_X_AUTHENTICATION_SCHEME'] = 'Session'
end
it 'has Session auth scheme' do

Loading…
Cancel
Save