From e9b0f3c54ed76cafa0a453c1417efa5846c99f5a Mon Sep 17 00:00:00 2001 From: Laurence Jones Date: Thu, 14 Mar 2024 15:36:47 +0000 Subject: [PATCH] wip: fix unix socket error (#2897) --- pkg/appsec/request.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/appsec/request.go b/pkg/appsec/request.go index 5b77f2285..a9eb0d372 100644 --- a/pkg/appsec/request.go +++ b/pkg/appsec/request.go @@ -342,6 +342,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())