Merge "set denied resp on requests to '/' in tempauth"
This commit is contained in:
commit
ad14871da6
@ -158,7 +158,7 @@ class TempAuth(object):
|
||||
version, rest = split_path(env.get('PATH_INFO', ''),
|
||||
1, 2, True)
|
||||
except ValueError:
|
||||
return HTTPNotFound()(env, start_response)
|
||||
version, rest = None, None
|
||||
if rest and rest.startswith(self.reseller_prefix):
|
||||
# Handle anonymous access to accounts I'm the definitive
|
||||
# auth for.
|
||||
|
@ -139,9 +139,11 @@ class TestAuth(unittest.TestCase):
|
||||
ath = auth.filter_factory({'auth_prefix': 'test'})(app)
|
||||
self.assertEquals(ath.auth_prefix, '/test/')
|
||||
|
||||
def test_top_level_ignore(self):
|
||||
def test_top_level_deny(self):
|
||||
resp = self._make_request('/').get_response(self.test_auth)
|
||||
self.assertEquals(resp.status_int, 404)
|
||||
self.assertEquals(resp.status_int, 401)
|
||||
self.assertEquals(resp.environ['swift.authorize'],
|
||||
self.test_auth.denied_response)
|
||||
|
||||
def test_anon(self):
|
||||
resp = \
|
||||
|
Loading…
x
Reference in New Issue
Block a user