diff --git a/cmd/gitea-mcp/main.go b/cmd/gitea-mcp/main.go index 550d1d9..b4ec929 100644 --- a/cmd/gitea-mcp/main.go +++ b/cmd/gitea-mcp/main.go @@ -57,25 +57,11 @@ func main() { Sessions: mcp.NewSessionStore(), }) - logReq := func(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - hasAuth := r.Header.Get("Authorization") != "" - logger.Info("request", - "method", r.Method, - "path", r.URL.Path, - "origin", r.Header.Get("Origin"), - "has_auth", hasAuth, - "user_agent", r.Header.Get("User-Agent"), - ) - next.ServeHTTP(w, r) - }) - } - mux := http.NewServeMux() - mux.Handle("/mcp", logReq(mcp.OriginAllowlist(cfg.OriginAllowlist)( + mux.Handle("/mcp", mcp.OriginAllowlist(cfg.OriginAllowlist)( auth.BearerMiddleware(cfg.GiteaBaseURL, cfg.DefaultToken, auth.CallerMiddleware(mcpSrv), - )), + ), )) mux.HandleFunc("/healthz", func(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(http.StatusOK)