From 1dfac7c5f7a43851479bf547f32868b34c3d2e7a Mon Sep 17 00:00:00 2001 From: hunshenshi <289517357@qq.com> Date: Thu, 16 May 2024 15:33:31 +0800 Subject: [PATCH] feat(auth): add log to whitelist --- auth/middleware.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/auth/middleware.go b/auth/middleware.go index 9d4f23b..7ae6c57 100644 --- a/auth/middleware.go +++ b/auth/middleware.go @@ -2,6 +2,7 @@ package auth import ( "context" + "log" "net/http" "strings" @@ -20,6 +21,7 @@ var JWTTokenMiddleware = func(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { api := r.URL.Path[strings.LastIndex(r.URL.Path, "/")+1:] for _, a := range whitelistAPI { + log.Println("whitelistAPI " + a) if strings.EqualFold(a, api) { ctx := context.WithValue(r.Context(), WhitelistCtxKey, true) h.ServeHTTP(w, r.WithContext(ctx))