From c295db0a49da25a0910c7de75ab7a05f91a526db Mon Sep 17 00:00:00 2001 From: Mark Rushakoff Date: Thu, 18 Feb 2016 12:34:29 -0800 Subject: [PATCH] Fix Content-Type headers in meta httpd --- services/meta/handler.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/meta/handler.go b/services/meta/handler.go index 55f4f30742..7ca17ec74e 100644 --- a/services/meta/handler.go +++ b/services/meta/handler.go @@ -254,6 +254,7 @@ func (h *handler) serveSnapshot(w http.ResponseWriter, r *http.Request) { h.httpError(err, w, http.StatusInternalServerError) return } + w.Header().Add("Content-Type", "application/octet-stream") w.Write(b) return case <-w.(http.CloseNotifier).CloseNotify(): @@ -312,6 +313,7 @@ func (h *handler) servePing(w http.ResponseWriter, r *http.Request) { } func (h *handler) servePeers(w http.ResponseWriter, r *http.Request) { + w.Header().Add("Content-Type", "application/json") enc := json.NewEncoder(w) if err := enc.Encode(h.store.peers()); err != nil { h.httpError(err, w, http.StatusInternalServerError) @@ -380,7 +382,7 @@ func (h *handler) serveLease(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) } // Write the lease data. - w.Header().Add("content-type", "application/json") + w.Header().Add("Content-Type", "application/json") w.Write(b) return }