chore: remove debug request logging
All checks were successful
CD / Lint / Test / Vet (push) Successful in 5s
CD / Build & Import (push) Successful in 11s
CD / Deploy via GitOps (push) Successful in 2s

Root cause confirmed (claude.ai sends no auth header); fallback token
is in place. Logging no longer needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mathias Bergqvist
2026-05-09 22:30:08 +02:00
parent 9d08352324
commit efbbd37882

View File

@@ -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)