From 4f6b26a2202a56db246fd0d8dfe4c305f6865de6 Mon Sep 17 00:00:00 2001 From: Felix Martin Date: Mon, 1 Jun 2026 19:24:19 -0400 Subject: [PATCH] Trust no proxies on the local server antidriftd binds localhost only and sits behind no proxy, so trusting all proxies (gin's default) is both wrong and a startup warning. Set an empty trusted-proxy list to disable forwarded-IP header trust and silence it. Co-Authored-By: Claude Opus 4.8 --- internal/web/web.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/web/web.go b/internal/web/web.go index 4a4e26b..f03f02e 100644 --- a/internal/web/web.go +++ b/internal/web/web.go @@ -40,6 +40,9 @@ func NewServer(ctrl *session.Controller) *Server { func (s *Server) Router() *gin.Engine { r := gin.New() r.Use(gin.Recovery()) + // antidriftd binds localhost only and sits behind no proxy, so trust no + // forwarded-IP headers. This also silences gin's trust-all-proxies warning. + _ = r.SetTrustedProxies(nil) sub, _ := fs.Sub(staticFS, "static") r.GET("/", func(c *gin.Context) {