From c8a2e56e929fa8d05fdc4f1d6263cfea6458390f Mon Sep 17 00:00:00 2001 From: Seednode Date: Wed, 19 Oct 2022 20:39:57 -0500 Subject: [PATCH] Skipped parsing query params if the corresponding flag isn't enabled --- cmd/version.go | 2 +- cmd/web.go | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cmd/version.go b/cmd/version.go index 09b3807..62e2782 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -10,7 +10,7 @@ import ( "github.com/spf13/cobra" ) -var Version = "0.15.0" +var Version = "0.15.1" func init() { rootCmd.AddCommand(versionCmd) diff --git a/cmd/web.go b/cmd/web.go index 93951a6..0633f17 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -208,10 +208,15 @@ func serveHtmlHandler(paths []string) appHandler { } filters := Filters{} - filters.Includes = splitQueryParams(r.URL.Query().Get("include")) - filters.Excludes = splitQueryParams(r.URL.Query().Get("exclude")) + if Filter { + filters.Includes = splitQueryParams(r.URL.Query().Get("include")) + filters.Excludes = splitQueryParams(r.URL.Query().Get("exclude")) + } - sortOrder := r.URL.Query().Get("sort") + sortOrder := "" + if Sort { + sortOrder = r.URL.Query().Get("sort") + } switch { case r.URL.Path == "/" && sortOrder == "asc" && refererUri != "":