mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-28 17:25:51 +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
|
// 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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user