Skip to content

Commit

Permalink
Returning correct Content-Type for /ping and /status API
Browse files Browse the repository at this point in the history
  • Loading branch information
vania-pooh committed Feb 25, 2018
1 parent 44017f8 commit c6606ae
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ func post(next http.HandlerFunc) http.HandlerFunc {
}

func ping(w http.ResponseWriter, _ *http.Request) {
w.Header().Add("Content-Type", "application/json")
json.NewEncoder(w).Encode(struct {
Uptime string `json:"uptime"`
LastReloadTime string `json:"lastReloadTime"`
Expand Down Expand Up @@ -285,6 +286,7 @@ func handler() http.Handler {
jsonError(w, "Session timed out or not found", http.StatusNotFound)
})
root.HandleFunc("/status", func(w http.ResponseWriter, r *http.Request) {
w.Header().Add("Content-Type", "application/json")
json.NewEncoder(w).Encode(conf.State(sessions, limit, queue.Queued(), queue.Pending()))
})
root.HandleFunc("/ping", ping)
Expand Down

0 comments on commit c6606ae

Please sign in to comment.