From 979a9e4d4cd68d9eb591b87cb0a35b4cf90dc9cc Mon Sep 17 00:00:00 2001 From: Seednode Date: Wed, 18 Jan 2023 19:14:39 -0600 Subject: [PATCH] Added 200 Ok response when clearing cache --- cmd/version.go | 2 +- cmd/web.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/version.go b/cmd/version.go index a724ae4..786ff9b 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -10,7 +10,7 @@ import ( "github.com/spf13/cobra" ) -var Version = "0.30.1" +var Version = "0.30.2" func init() { rootCmd.AddCommand(versionCmd) diff --git a/cmd/web.go b/cmd/web.go index 318b775..1dea9df 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -345,6 +345,10 @@ func serveCacheClearHandler(args []string, fileCache *[]string) http.HandlerFunc if err != nil { fmt.Println(err) } + + w.WriteHeader(http.StatusOK) + w.Header().Set("Content-Type", "text/plain") + w.Write([]byte("Ok")) } } }