mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-14 11:09:44 +08:00
Fix the failing test of test_auth_header_not_set
This commit is contained in:
@@ -244,7 +244,11 @@ def get_user_kerberos(request):
|
||||
user = None
|
||||
if 'Authorization' not in request.headers:
|
||||
response = Response('Unauthorized', 401, {'WWW-Authenticate': 'Negotiate'})
|
||||
raise FlaskUnauthorized(response=response)
|
||||
exc = FlaskUnauthorized()
|
||||
# For some reason, certain versions of werkzeug raise an exception when passing `response`
|
||||
# in the constructor. This is a work-around.
|
||||
exc.response = response
|
||||
raise exc
|
||||
header = request.headers.get('Authorization')
|
||||
token = ''.join(header.strip().split()[1:])
|
||||
user, kerberos_token = KerberosAuthenticate().process_request(token)
|
||||
|
||||
Reference in New Issue
Block a user