wip: fix unix socket error (#2897)

This commit is contained in:
Laurence Jones 2024-03-14 15:36:47 +00:00 committed by GitHub
parent a6b0e58380
commit e9b0f3c54e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -342,6 +342,10 @@ func NewParsedRequestFromRequest(r *http.Request, logger *logrus.Entry) (ParsedR
} }
var remoteAddrNormalized string 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) host, _, err := net.SplitHostPort(r.RemoteAddr)
if err != nil { if err != nil {
log.Errorf("Invalid appsec remote IP source %v: %s", r.RemoteAddr, err.Error()) log.Errorf("Invalid appsec remote IP source %v: %s", r.RemoteAddr, err.Error())