Skip to content

Commit adaa2ea

Browse files
author
Nathaniel Cook
authored
Merge pull request #32 from simcap/support_ping
Provide satisfactory response to {GET, HEAD} /ping
2 parents 86e827c + 8d668af commit adaa2ea

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

relay/http.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,13 @@ func (h *HTTP) Stop() error {
112112

113113
func (h *HTTP) ServeHTTP(w http.ResponseWriter, r *http.Request) {
114114
start := time.Now()
115+
116+
if r.URL.Path == "/ping" && (r.Method == "GET" || r.Method == "HEAD") {
117+
w.Header().Add("X-InfluxDB-Version", "relay")
118+
w.WriteHeader(http.StatusNoContent)
119+
return
120+
}
121+
115122
if r.URL.Path != "/write" {
116123
jsonError(w, http.StatusNotFound, "invalid write endpoint")
117124
return

0 commit comments

Comments
 (0)