#1178 Fix the failing test of test_auth_header_not_set
Merged 5 years ago by mprahl. Opened 5 years ago by mprahl.

file modified
+5 -1
@@ -244,7 +244,11 @@ 

      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)

For some reason, certain versions of werkzeug raise an exception when passing response in the constructor. This is a work-around.

rebased onto f81c25d

5 years ago

Pull-Request has been merged by mprahl

5 years ago