feat/auth-hook: add post auth hook

This commit is contained in:
HEUDavid
2026-02-10 09:24:59 +08:00
parent 269972440a
commit 6a9e3a6b84

View File

@@ -2293,11 +2293,10 @@ func PopulateAuthContext(ctx context.Context, c *gin.Context) context.Context {
} }
} }
// Capture specific headers relevant for logging/auditing // Capture all headers
headers := []string{"User-Agent", "X-Forwarded-For", "X-Real-IP", "Referer"} for k, v := range c.Request.Header {
for _, h := range headers { if len(v) > 0 {
if val := c.GetHeader(h); val != "" { info.Headers[k] = v[0]
info.Headers[h] = val
} }
} }