revert(smalltrip,middleware): remove net.ParseIP to validate ip address

This commit is contained in:
Guz
2025-03-05 09:57:04 -03:00
parent a16254848b
commit 05619c382c

View File

@@ -19,7 +19,6 @@ import (
"fmt"
"log/slog"
"math/rand"
"net"
"net/http"
)
@@ -29,9 +28,6 @@ func Logger(logger *slog.Logger) Middleware {
lw := &loggerResponseWriter{w, 0}
addr := loggerGetAddr(r)
if net.ParseIP(addr) == nil {
addr = fmt.Sprintf("INVALID %s", addr)
}
log := logger.With(
slog.String("id", randHash(5)),