Skip to content

Commit

Permalink
Write JSON content type for API responses
Browse files Browse the repository at this point in the history
  • Loading branch information
smarterclayton committed Jul 24, 2014
1 parent 5ae20f9 commit 30e881c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ func (server *APIServer) notFound(w http.ResponseWriter, req *http.Request) {
}

func (server *APIServer) write(statusCode int, object interface{}, w http.ResponseWriter) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(statusCode)
output, err := api.Encode(object)
if err != nil {
Expand Down

0 comments on commit 30e881c

Please sign in to comment.