Merge "Fix text/plain mime type with healthcheck endpoint" into stable/xena
This commit is contained in:
commit
3a141a079d
@ -39,7 +39,7 @@ class RootController(object):
|
||||
|
||||
# Run the oslo middleware healthcheck for /healthcheck
|
||||
@pecan_expose('json')
|
||||
@pecan_expose(content_type='plain/text')
|
||||
@pecan_expose(content_type='text/plain')
|
||||
@pecan_expose(content_type='text/html')
|
||||
def healthcheck(self): # pylint: disable=inconsistent-return-statements
|
||||
if CONF.api_settings.healthcheck_enabled:
|
||||
|
@ -114,6 +114,20 @@ class TestHealthCheck(base_db_test.OctaviaDBTestBase):
|
||||
self.assertEqual(200, response.status_code)
|
||||
self.assertEqual('OK', response.text)
|
||||
|
||||
def test_healthcheck_get_text_plain(self):
|
||||
self.conf.config(group='healthcheck', detailed=False)
|
||||
response = self._get(self._get_enabled_app(), '/healthcheck',
|
||||
headers={'Accept': 'text/plain'})
|
||||
self.assertEqual(200, response.status_code)
|
||||
self.assertEqual('OK', response.text)
|
||||
|
||||
def test_healthcheck_get_text_plain_detailed(self):
|
||||
self.conf.config(group='healthcheck', detailed=True)
|
||||
response = self._get(self._get_enabled_app(), '/healthcheck',
|
||||
headers={'Accept': 'text/plain'})
|
||||
self.assertEqual(200, response.status_code)
|
||||
self.assertEqual('OK', response.text)
|
||||
|
||||
def test_healthcheck_get_json(self):
|
||||
self.conf.config(group='healthcheck', detailed=False)
|
||||
response = self._get(self._get_enabled_app(), '/healthcheck',
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixed the ability to use the 'text/plain' mime type with the healthcheck
|
||||
endpoint.
|
Loading…
Reference in New Issue
Block a user