Removed explicit w.WriteHeader(http.StatusOK) calls in favor of implicit

This commit is contained in:
Seednode 2023-06-22 05:10:40 -05:00
parent 40ed9889f9
commit 830e661223
2 changed files with 1 additions and 6 deletions

View File

@ -11,7 +11,7 @@ import (
) )
const ( const (
Version string = "0.53.0" Version string = "0.53.1"
) )
var ( var (

View File

@ -625,8 +625,6 @@ func serveCacheClear(args []string, index *Index) httprouter.Handle {
return func(w http.ResponseWriter, r *http.Request, p httprouter.Params) { return func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
index.generateCache(args) index.generateCache(args)
w.WriteHeader(http.StatusOK)
w.Header().Set("Content-Type", "text/plain") w.Header().Set("Content-Type", "text/plain")
w.Write([]byte("Ok")) w.Write([]byte("Ok"))
@ -635,7 +633,6 @@ func serveCacheClear(args []string, index *Index) httprouter.Handle {
func serveStats(args []string, stats *ServeStats) httprouter.Handle { func serveStats(args []string, stats *ServeStats) httprouter.Handle {
return func(w http.ResponseWriter, r *http.Request, p httprouter.Params) { return func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
w.WriteHeader(http.StatusOK)
w.Header().Set("Content-Type", "application/json") w.Header().Set("Content-Type", "application/json")
startTime := time.Now() startTime := time.Now()
@ -683,7 +680,6 @@ func serveStats(args []string, stats *ServeStats) httprouter.Handle {
func serveDebugHtml(args []string, index *Index) httprouter.Handle { func serveDebugHtml(args []string, index *Index) httprouter.Handle {
return func(w http.ResponseWriter, r *http.Request, p httprouter.Params) { return func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
w.WriteHeader(http.StatusOK)
w.Header().Set("Content-Type", "text/html") w.Header().Set("Content-Type", "text/html")
startTime := time.Now() startTime := time.Now()
@ -738,7 +734,6 @@ func serveDebugHtml(args []string, index *Index) httprouter.Handle {
func serveDebugJson(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) { return func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
w.WriteHeader(http.StatusOK)
w.Header().Set("Content-Type", "application/json") w.Header().Set("Content-Type", "application/json")
startTime := time.Now() startTime := time.Now()