Skip to content

Commit f563b67

Browse files
Merge pull request #1266 from mmatuska/fix/extractIPAddress
server/util.go: fix logic in extractIPAddress()
2 parents ea1cda5 + bd39cf4 commit f563b67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func extractIPAddress(r *http.Request, behindProxy bool) netip.Addr {
8282
ip, err = netip.ParseAddr(remoteAddr)
8383
if err != nil {
8484
ip = netip.IPv4Unspecified()
85-
if remoteAddr != "@" || !behindProxy { // RemoteAddr is @ when unix socket is used
85+
if remoteAddr != "@" && !behindProxy { // RemoteAddr is @ when unix socket is used
8686
logr(r).Err(err).Warn("unable to parse IP (%s), new visitor with unspecified IP (0.0.0.0) created", remoteAddr)
8787
}
8888
}

0 commit comments

Comments
 (0)