mirror of
https://github.com/wassname/flask-security.git
synced 2026-07-24 13:00:36 +08:00
Fixed http_auth when authorization is not provided in header
This commit is contained in:
@@ -142,6 +142,13 @@ class DefaultSecurityTests(SecurityTest):
|
||||
})
|
||||
self.assertIn('HTTP Authentication', r.data)
|
||||
|
||||
def test_http_auth_no_authorization(self):
|
||||
r = self._get('/http', headers={})
|
||||
self.assertIn('<h1>Unauthorized</h1>', r.data)
|
||||
self.assertIn('WWW-Authenticate', r.headers)
|
||||
self.assertEquals('Basic realm="Login Required"',
|
||||
r.headers['WWW-Authenticate'])
|
||||
|
||||
def test_invalid_http_auth_invalid_username(self):
|
||||
r = self._get('/http', headers={
|
||||
'Authorization': 'Basic ' + base64.b64encode("bogus:bogus")
|
||||
|
||||
Reference in New Issue
Block a user