debug
All checks were successful
release-tag / release-image (push) Successful in 1m52s

This commit is contained in:
2025-06-18 12:37:32 +02:00
parent 8ae64e5619
commit cf6a812004

View File

@@ -247,6 +247,8 @@ func handleDashboardJSON(w http.ResponseWriter, r *http.Request) {
func getClientIP(r *http.Request) string { func getClientIP(r *http.Request) string {
xff := r.Header.Get("X-Forwarded-For") xff := r.Header.Get("X-Forwarded-For")
xrip := r.Header.Get("X-Real-Ip")
log.Printf("X-Forwarded-For: %s, X-Real-Ip: %s, RemoteAddr: %s", xff, xrip, r.RemoteAddr)
if xff != "" { if xff != "" {
parts := strings.Split(xff, ",") parts := strings.Split(xff, ",")
ip := strings.TrimSpace(parts[0]) ip := strings.TrimSpace(parts[0])
@@ -254,7 +256,7 @@ func getClientIP(r *http.Request) string {
return ip return ip
} }
} }
xrip := r.Header.Get("X-Real-Ip")
if xrip != "" && isValidIP(xrip) { if xrip != "" && isValidIP(xrip) {
return xrip return xrip
} }