add support for different bandwidth limits based on client IP

This commit is contained in:
Nicola Murino
2021-12-10 18:43:26 +01:00
parent c153330ab8
commit 0bb141960f
18 changed files with 575 additions and 56 deletions

View File

@@ -492,7 +492,7 @@ func GetRealIP(r *http.Request) string {
} else if clientIP := r.Header.Get(cfConnectingIP); clientIP != "" {
ip = clientIP
} else if xff := r.Header.Get(xForwardedFor); xff != "" {
i := strings.Index(xff, ", ")
i := strings.Index(xff, ",")
if i == -1 {
i = len(xff)
}