Skip to content

Commit

Permalink
Merge pull request #32 from simcap/support_ping
Browse files Browse the repository at this point in the history
Provide satisfactory response to {GET, HEAD} /ping
  • Loading branch information
Nathaniel Cook authored Nov 14, 2016
2 parents 86e827c + 8d668af commit adaa2ea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions relay/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ func (h *HTTP) Stop() error {

func (h *HTTP) ServeHTTP(w http.ResponseWriter, r *http.Request) {
start := time.Now()

if r.URL.Path == "/ping" && (r.Method == "GET" || r.Method == "HEAD") {
w.Header().Add("X-InfluxDB-Version", "relay")
w.WriteHeader(http.StatusNoContent)
return
}

if r.URL.Path != "/write" {
jsonError(w, http.StatusNotFound, "invalid write endpoint")
return
Expand Down

0 comments on commit adaa2ea

Please sign in to comment.