Просмотр исходного кода

server/util.go: fix logic in extractIPAddress()

Martin Matuska 1 год назад
Родитель
Сommit
bd39cf4b54
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      server/util.go

+ 1 - 1
server/util.go

@@ -82,7 +82,7 @@ func extractIPAddress(r *http.Request, behindProxy bool) netip.Addr {
 		ip, err = netip.ParseAddr(remoteAddr)
 		if err != nil {
 			ip = netip.IPv4Unspecified()
-			if remoteAddr != "@" || !behindProxy { // RemoteAddr is @ when unix socket is used
+			if remoteAddr != "@" && !behindProxy { // RemoteAddr is @ when unix socket is used
 				logr(r).Err(err).Warn("unable to parse IP (%s), new visitor with unspecified IP (0.0.0.0) created", remoteAddr)
 			}
 		}