Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix health check endpoint #262

Merged
merged 1 commit into from
May 24, 2019
Merged

Conversation

zhouzhuojie
Copy link
Collaborator

@zhouzhuojie zhouzhuojie commented May 24, 2019

Fix #261

The reason is that gzip middleware zips empty response without setting content-type, which was empty set in the health swagger definition.

This pr adds a JSON representation of the health check status:

{
  "status": "OK"
}

Which may be extended to other things from flagr server.

@codecov-io
Copy link

codecov-io commented May 24, 2019

Codecov Report

Merging #262 into master will decrease coverage by 0.1%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #262      +/-   ##
==========================================
- Coverage      82%   81.89%   -0.11%     
==========================================
  Files          26       26              
  Lines        1528     1530       +2     
==========================================
  Hits         1253     1253              
- Misses        207      209       +2     
  Partials       68       68
Impacted Files Coverage Δ
pkg/handler/handler.go 82% <0%> (-3.42%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e701af9...484680f. Read the comment docs.

@zhouzhuojie zhouzhuojie force-pushed the zz/fix-health-check-endpoint branch from 510b6e9 to f9f7224 Compare May 24, 2019 21:39
@zhouzhuojie zhouzhuojie force-pushed the zz/fix-health-check-endpoint branch from f9f7224 to 484680f Compare May 24, 2019 21:40
@@ -37,7 +37,7 @@ Install Dependencies.

- Go
- Make (for Makefile)
- Yarn (for building UI)
- Yarn and NPM (for building UI)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plan to migrate to npm only in the near future.

@zhouzhuojie
Copy link
Collaborator Author

Tested locally.

curl -i localhost:18000/api/v1/health
HTTP/1.1 200 OK
Content-Type: application/json
Vary: Origin
Date: Fri, 24 May 2019 21:31:09 GMT
Content-Length: 16

{"status":"OK"}

@zhouzhuojie zhouzhuojie merged commit 1293e27 into master May 24, 2019
@zhouzhuojie zhouzhuojie deleted the zz/fix-health-check-endpoint branch May 24, 2019 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Healthcheck Downloading Gzip file?
2 participants