aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2024-03-05 12:13:56 +0100
committerTaras Madan <tarasmadan@google.com>2024-03-05 11:25:19 +0000
commit18c4803efdcc256364c4dcfd9eca5176e277844f (patch)
tree52bfdef8c1d2d20e5159af3e0120dffcf5e3a5b3
parent9ed46f6427103800294851039efc208dca8b80fb (diff)
all: fix json=0 error
Currently json=0 and json=1 give the same result.
-rw-r--r--dashboard/app/main.go6
-rw-r--r--syz-manager/http.go2
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
}