mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-28 13:44:41 +08:00
feat/auth-hook: add post auth hook
This commit is contained in:
@@ -2293,11 +2293,10 @@ func PopulateAuthContext(ctx context.Context, c *gin.Context) context.Context {
|
||||
}
|
||||
}
|
||||
|
||||
// Capture specific headers relevant for logging/auditing
|
||||
headers := []string{"User-Agent", "X-Forwarded-For", "X-Real-IP", "Referer"}
|
||||
for _, h := range headers {
|
||||
if val := c.GetHeader(h); val != "" {
|
||||
info.Headers[h] = val
|
||||
// Capture all headers
|
||||
for k, v := range c.Request.Header {
|
||||
if len(v) > 0 {
|
||||
info.Headers[k] = v[0]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user