diff options
author | clsr <clsr@clsr.net> | 2016-11-12 14:53:57 +0100 |
---|---|---|
committer | clsr <clsr@clsr.net> | 2016-11-12 14:53:57 +0100 |
commit | 1893c0672016fef04e1536ee4fa6c7914dd84bd2 (patch) | |
tree | 9b627c2995e445aeb59ec60a2d6524310ba9c337 | |
parent | 3abf0f3d7ad277404fd94a605a8070f5c23017ed (diff) | |
download | gomf-1893c0672016fef04e1536ee4fa6c7914dd84bd2.tar.gz gomf-1893c0672016fef04e1536ee4fa6c7914dd84bd2.zip |
Make json the default output mode
-rw-r--r-- | api.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -136,7 +136,7 @@ func respond(w http.ResponseWriter, mode string, resp response) { w.WriteHeader(code) switch mode { - case "json": + case "json", "": w.Header().Set("Content-Type", "application/json") json.NewEncoder(w).Encode(resp) @@ -169,7 +169,7 @@ func respond(w http.ResponseWriter, mode string, resp response) { } wr.Flush() - case "", "html": + case "html": w.Header().Set("Content-Type", "text/html") context := newContext() context.Result = resp |