From 830e6612234a2c6b37e51df275bba998a426924a Mon Sep 17 00:00:00 2001 From: Seednode Date: Thu, 22 Jun 2023 05:10:40 -0500 Subject: [PATCH] Removed explicit w.WriteHeader(http.StatusOK) calls in favor of implicit --- cmd/root.go | 2 +- cmd/web.go | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index c99c8ab..d78ac06 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -11,7 +11,7 @@ import ( ) const ( - Version string = "0.53.0" + Version string = "0.53.1" ) var ( diff --git a/cmd/web.go b/cmd/web.go index 14fbdc6..42e4424 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -625,8 +625,6 @@ func serveCacheClear(args []string, index *Index) httprouter.Handle { return func(w http.ResponseWriter, r *http.Request, p httprouter.Params) { index.generateCache(args) - w.WriteHeader(http.StatusOK) - w.Header().Set("Content-Type", "text/plain") w.Write([]byte("Ok")) @@ -635,7 +633,6 @@ func serveCacheClear(args []string, index *Index) httprouter.Handle { func serveStats(args []string, stats *ServeStats) httprouter.Handle { return func(w http.ResponseWriter, r *http.Request, p httprouter.Params) { - w.WriteHeader(http.StatusOK) w.Header().Set("Content-Type", "application/json") startTime := time.Now() @@ -683,7 +680,6 @@ func serveStats(args []string, stats *ServeStats) httprouter.Handle { func serveDebugHtml(args []string, index *Index) httprouter.Handle { return func(w http.ResponseWriter, r *http.Request, p httprouter.Params) { - w.WriteHeader(http.StatusOK) w.Header().Set("Content-Type", "text/html") startTime := time.Now() @@ -738,7 +734,6 @@ func serveDebugHtml(args []string, index *Index) httprouter.Handle { func serveDebugJson(args []string, index *Index) httprouter.Handle { return func(w http.ResponseWriter, r *http.Request, p httprouter.Params) { - w.WriteHeader(http.StatusOK) w.Header().Set("Content-Type", "application/json") startTime := time.Now()