Skip to content

Commit

Permalink
fix: Healthcheck content-type (#1110)
Browse files Browse the repository at this point in the history
  • Loading branch information
luislhl authored Aug 22, 2024
1 parent f6ddf3c commit da32f80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions hathor/healthcheck/resources/healthcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def _render_success(self, result: HealthcheckResponse, request: Request) -> None
status_code = result.get_http_status_code()
request.setResponseCode(status_code)

request.setHeader(b'content-type', b'application/json; charset=utf-8')
request.write(json_dumpb(result.to_json()))
request.finish()

Expand Down
1 change: 1 addition & 0 deletions tests/resources/healthcheck/test_healthcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ def test_get_ready(self):
response = yield self.web.get('/health')
data = response.json_value()

self.assertTrue('application/json; charset=utf-8' in response.responseHeaders.getRawHeaders('content-type'))
self.assertEqual(response.responseCode, 200)
self.assertEqual(data, {
'status': 'pass',
Expand Down

0 comments on commit da32f80

Please sign in to comment.