Merge pull request #1255 from jzelinskie/wwwauth

v2: always send www-authn headers on unauthorized
This commit is contained in:
Jimmy Zelinskie 2016-02-22 12:49:37 -05:00
commit 01b9606481
2 changed files with 7 additions and 1 deletions

View file

@ -1319,7 +1319,10 @@ class V2RegistryTests(V2RegistryPullMixin, V2RegistryPushMixin, RegistryTestsMix
self.assertEquals(len(data['tags']), 1)
# Try to get tags before a repo exists.
self.conduct('GET', '/v2/devtable/doesnotexist/tags/list', auth='jwt', expected_code=401)
response = self.conduct('GET', '/v2/devtable/doesnotexist/tags/list', auth='jwt', expected_code=401)
# Assert 401s to non-auth endpoints also get the WWW-Authenticate header.
self.assertIn('WWW-Authenticate', response.headers)
def test_one_five_blacklist(self):
self.conduct('GET', '/v2/', expected_code=404, user_agent='Go 1.1 package http')