aboutsummaryrefslogtreecommitdiff
path: root/core.go
diff options
context:
space:
mode:
authorDoug Black <dblack@twilio.com>2014-01-28 13:54:09 -0500
committerDoug Black <dblack@twilio.com>2014-01-28 13:54:09 -0500
commitf53e337a27a480a962ef6d1237c8393a618e6db3 (patch)
treecb52b3b7adee848bf27fe99fd03db848593cc1e8 /core.go
parentdoc fix (diff)
downloadsleepy-f53e337a27a480a962ef6d1237c8393a618e6db3.tar.gz
sleepy-f53e337a27a480a962ef6d1237c8393a618e6db3.tar.bz2
sleepy-f53e337a27a480a962ef6d1237c8393a618e6db3.zip
only write header once
Diffstat (limited to 'core.go')
-rw-r--r--core.go1
1 files changed, 1 insertions, 0 deletions
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)
bgstack15