From f53e337a27a480a962ef6d1237c8393a618e6db3 Mon Sep 17 00:00:00 2001 From: Doug Black Date: Tue, 28 Jan 2014 13:54:09 -0500 Subject: only write header once --- core.go | 1 + 1 file changed, 1 insertion(+) diff --git a/core.go b/core.go index 03db6e8..296483c 100644 --- a/core.go +++ b/core.go @@ -93,6 +93,7 @@ func (api *API) requestHandler(resource interface{}) http.HandlerFunc { content, err := json.Marshal(data) if err != nil { rw.WriteHeader(http.StatusInternalServerError) + return } rw.WriteHeader(code) rw.Write(content) -- cgit