From 18c4803efdcc256364c4dcfd9eca5176e277844f Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Tue, 5 Mar 2024 12:13:56 +0100 Subject: all: fix json=0 error Currently json=0 and json=1 give the same result. --- dashboard/app/main.go | 6 +++--- syz-manager/http.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dashboard/app/main.go b/dashboard/app/main.go index 7ae2163fe..6e8b34b19 100644 --- a/dashboard/app/main.go +++ b/dashboard/app/main.go @@ -533,7 +533,7 @@ func handleMain(c context.Context, w http.ResponseWriter, r *http.Request) error BugFilter: makeUIBugFilter(c, filter), } - if r.FormValue("json") != "" { + if r.FormValue("json") == "1" { w.Header().Set("Content-Type", "application/json") return writeJSONVersionOf(w, data) } @@ -860,7 +860,7 @@ func handleTerminalBugList(c context.Context, w http.ResponseWriter, r *http.Req BugFilter: makeUIBugFilter(c, typ.Filter), } - if r.FormValue("json") != "" { + if r.FormValue("json") == "1" { w.Header().Set("Content-Type", "application/json") return writeJSONVersionOf(w, data) } @@ -1171,7 +1171,7 @@ func handleBug(c context.Context, w http.ResponseWriter, r *http.Request) error "Cause bisection attempts", uiList)) } } - if r.FormValue("json") != "" { + if r.FormValue("json") == "1" { w.Header().Set("Content-Type", "application/json") return writeJSONVersionOf(w, data) } diff --git a/syz-manager/http.go b/syz-manager/http.go index 2b7327ba7..5578705bf 100644 --- a/syz-manager/http.go +++ b/syz-manager/http.go @@ -261,7 +261,7 @@ func (mgr *Manager) httpCover(w http.ResponseWriter, r *http.Request) { mgr.httpCoverFallback(w, r) return } - if r.FormValue("json") != "" { + if r.FormValue("json") == "1" { mgr.httpCoverCover(w, r, DoCoverJSON) return } -- cgit mrf-deployment