From 1b63e389a386c79e4057fe3637dbf731a801fcfa Mon Sep 17 00:00:00 2001 From: Laurence Date: Thu, 14 Mar 2024 13:04:07 +0000 Subject: [PATCH] wip: fix unix socket error --- pkg/appsec/request.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/appsec/request.go b/pkg/appsec/request.go index effb1828307..35d42929400 100644 --- a/pkg/appsec/request.go +++ b/pkg/appsec/request.go @@ -341,6 +341,10 @@ func NewParsedRequestFromRequest(r *http.Request, logger *logrus.Entry) (ParsedR } var remoteAddrNormalized string + if r.RemoteAddr == "@" { + r.RemoteAddr = "127.0.0.1:65535" + } + // TODO we need to implement forwrded headers host, _, err := net.SplitHostPort(r.RemoteAddr) if err != nil { log.Errorf("Invalid appsec remote IP source %v: %s", r.RemoteAddr, err.Error())