From 1893c0672016fef04e1536ee4fa6c7914dd84bd2 Mon Sep 17 00:00:00 2001 From: clsr Date: Sat, 12 Nov 2016 14:53:57 +0100 Subject: Make json the default output mode --- api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api.go b/api.go index 7df3332..49b8a61 100644 --- a/api.go +++ b/api.go @@ -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 -- cgit