Honour forwarded headers only from trusted proxies (closes #259)
check / check (push) Failing after 6s

A new ClientIP middleware sets request.RemoteAddr to the client's
address before the request is logged. X-Forwarded-For and X-Real-IP
count only when the peer is in TRUSTED_PROXIES, which defaults to the
RFC 1918 ranges. The login rate limit, the session's IP address and
hostname, and the request log all use that address.

Model: opus-5-5
This commit is contained in:
sneak committed 2026-11-10 19:57:27 +00:00
1 parent bc8aa6bb96
commit 51d9d774fd
10 files changed
+519 -42

No files matched your search

+1
View File
@@ -23,6 +23,7 @@ func (srv *Server) SetupRoutes() {
srv.router.Use(middleware.Recoverer)
srv.router.Use(middleware.RequestID)
srv.router.Use(srv.mw.ClientIP())
srv.router.Use(srv.mw.Logging())
if viper.GetString("METRICS_USERNAME") != "" {