Ensure HEAD is supported with simple cert

This changes makes it so simple cert GET requests also support HEAD.

Change-Id: Id930c783a7adf96e3a3bf41b527df83735c9fbd5
Partial-Bug: 1696574
This commit is contained in:
Lance Bragstad 2017-06-13 16:03:38 +00:00
parent a83257f756
commit 9d0f7a5357
2 changed files with 8 additions and 2 deletions

View File

@ -36,6 +36,12 @@ class TestSimpleCert(BaseTestCase):
self.assertEqual(content_type, response.content_type.lower())
self.assertIn(b'---BEGIN', response.body)
# Test the same path with HEAD
self.request(
app=self.public_app, method='HEAD', path=path,
headers={'Accept': content_type}, expected_status=http_client.OK
)
return response
def test_ca_cert(self):

View File

@ -60,12 +60,12 @@ class Routers(wsgi.RoutersBase):
self._add_resource(
mapper, controller,
path=self._construct_url('ca'),
get_action='get_ca_certificate',
get_head_action='get_ca_certificate',
rel=build_resource_relation(resource_name='ca_certificate'))
self._add_resource(
mapper, controller,
path=self._construct_url('certificates'),
get_action='list_certificates',
get_head_action='list_certificates',
rel=build_resource_relation(resource_name='certificates'))