Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Made it so the header isn't written more than once
Browse files Browse the repository at this point in the history
  • Loading branch information
tiffanyfay committed Oct 29, 2015
1 parent 1972186 commit 73a4c8e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mgmt/rest/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,9 @@ func respond(code int, b rbody.Body, w http.ResponseWriter) {
},
Body: b,
}

w.WriteHeader(code)
if !w.(negroni.ResponseWriter).Written() {
w.WriteHeader(code)
}

j, err := json.MarshalIndent(resp, "", " ")
if err != nil {
Expand Down

0 comments on commit 73a4c8e

Please sign in to comment.