Commit 4b751954 authored by Matthew Sykes's avatar Matthew Sykes
Browse files

[FAB-13189] set content-type for logspec response



Change-Id: I4538e9c2f2f0f16e0a0362aa71df8496fe4228fd
Signed-off-by: default avatarMatthew Sykes <sykesmat@us.ibm.com>
parent 9521e368
......@@ -75,6 +75,7 @@ func (h *SpecHandler) sendResponse(resp http.ResponseWriter, code int, payload i
resp.WriteHeader(code)
resp.Header().Set("Content-Type", "application/json")
if err := encoder.Encode(payload); err != nil {
h.Logger.Errorw("failed to encode payload", "error", err)
}
......
......@@ -41,6 +41,7 @@ var _ = Describe("SpecHandler", func() {
Expect(fakeLogging.SpecCallCount()).To(Equal(1))
Expect(resp.Code).To(Equal(http.StatusOK))
Expect(resp.Body).To(MatchJSON(`{"spec": "the-returned-specification"}`))
Expect(resp.Header().Get("Content-Type")).To(Equal("application/json"))
})
It("sets the current logging spec", func() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment