Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
Allow usage of "/" as LH_HEALTHCHECK_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
tienshiao committed Feb 28, 2021
1 parent 51cb531 commit 218a213
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions health.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import (
)

func waitForHealthy(ctx context.Context, port string) {
path := strings.TrimPrefix(os.Getenv("LH_HEALTHCHECK_PATH"), "/")
path := os.Getenv("LH_HEALTHCHECK_PATH")
if path == "" {
path = "ping"
path = "/ping"
}
path = strings.TrimPrefix(path, "/")

url := fmt.Sprintf("http://127.0.0.1:%s/%s", port, path)

Expand Down

0 comments on commit 218a213

Please sign in to comment.