Respond to /health and /version by request path rather than the whole url string
Request for /health?_t=anything won't return the health info, neither would request for /version if there exists extra query string.
Can we route the /health and /version by request path instead of the whole url string? I can make a pull request if it's okay.
substitute the switch r.URL.String() with switch r.URL.Path:
switch r.URL.Path {
case "/health":
w.Write([]byte("OK\n"))
return
case "/version":
w.Write([]byte(chshare.BuildVersion))
return
}
send a PR?
On Wed, 19 Jan 2022 at 2:28 am BigSully @.***> wrote:
Request for /health?_t=anything won't return the health info, neither would request for /version if there exists extra query string.
Can we route the /health and /version by request path instead of the whole url string? I can make a pull request if it's okay.
substitute the switch r.URL.String() https://github.com/jpillora/chisel/blob/v1.7.6/server/server_handler.go#L37 with switch r.URL.Path:
switch r.URL.Path { case "/health": w.Write([]byte("OK\n")) return case "/version": w.Write([]byte(chshare.BuildVersion)) return }
— Reply to this email directly, view it on GitHub https://github.com/jpillora/chisel/issues/327, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAE2X4ZX6MESO7U7P37VEZ3UWWBIHANCNFSM5MHPDCRQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>