We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40afc13 commit ba8a1b7Copy full SHA for ba8a1b7
1 file changed
internal/honeypot/naive/naive.go
@@ -6,7 +6,6 @@ import (
6
"fmt"
7
"log/slog"
8
"math/rand/v2"
9
- "net"
10
"net/http"
11
"net/netip"
12
"time"
@@ -154,8 +153,7 @@ func (i *Impl) ServeHTTP(w http.ResponseWriter, r *http.Request) {
154
153
155
realIP, _ := internal.RealIP(r)
156
if !realIP.IsValid() {
157
- host, _, _ := net.SplitHostPort(r.RemoteAddr)
158
- realIP = netip.MustParseAddr(host)
+ realIP = netip.MustParseAddr(r.Header.Get("X-Real-Ip"))
159
}
160
161
network, ok := internal.ClampIP(realIP)
0 commit comments