From 6e1113175ecb76c39a61ba9bf57ba81d1c13c162 Mon Sep 17 00:00:00 2001 From: Nguyen Marc Date: Sat, 27 Jan 2024 02:51:53 +0100 Subject: [PATCH] fix(auth): possible path escape --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index e7798ec..08a22b0 100644 --- a/main.go +++ b/main.go @@ -241,7 +241,10 @@ var app = &cli.App{ http.Error(w, err.Error(), http.StatusInternalServerError) } } - r.With(jwt.Deny).Get("/counter", renderFn) + r.Route("/counter", func(r chi.Router) { + r.Use(jwt.Deny) + r.Get("/", renderFn) + }) r.Get("/*", renderFn) r.Handle("/static/*", http.FileServer(http.FS(static)))