From c4c99dfac57d26e1fdb2b6079f2916c391833689 Mon Sep 17 00:00:00 2001 From: Fabricio Date: Sun, 24 Mar 2019 10:34:38 -0300 Subject: [PATCH] remove not found --- main.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/main.go b/main.go index ef029d4..3c8477c 100644 --- a/main.go +++ b/main.go @@ -103,10 +103,6 @@ func NewDashboardRetryHandler(list *CaptureList, next http.HandlerFunc) http.Han return func(rw http.ResponseWriter, req *http.Request) { id := req.URL.Path[strings.LastIndex(req.URL.Path, "/")+1:] capture := list.Find(id) - if capture == nil { - http.Error(rw, "Item Not Found", http.StatusNotFound) - return - } var reqBody []byte capture.Req.Body, reqBody = drain(capture.Req.Body) r, _ := http.NewRequest(capture.Req.Method, capture.Req.URL.String(), bytes.NewReader(reqBody)) @@ -120,10 +116,6 @@ func NewDashboardItemInfoHandler(list *CaptureList) http.HandlerFunc { return func(rw http.ResponseWriter, req *http.Request) { id := req.URL.Path[strings.LastIndex(req.URL.Path, "/")+1:] capture := list.Find(id) - if capture == nil { - http.Error(rw, "Item Not Found", http.StatusNotFound) - return - } rw.Header().Add("Content-Type", "application/json") json.NewEncoder(rw).Encode(dump(capture)) }