mirror of
https://github.com/sot-tech/mochi.git
synced 2026-06-21 03:38:26 -07:00
Read RealIP header from the request header map
This commit is contained in:
+1
-1
@@ -143,7 +143,7 @@ func requestedIP(q *query.Query, r *http.Request, cfg *config.NetConfig) (v4, v6
|
||||
}
|
||||
|
||||
if cfg.RealIPHeader != "" {
|
||||
if xRealIPs, ok := q.Params[cfg.RealIPHeader]; ok {
|
||||
if xRealIPs, ok := r.Header[cfg.RealIPHeader]; ok {
|
||||
if v4, v6, done = getIPs(string(xRealIPs[0]), v4, v6, cfg); done {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user