1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-05-30 18:29:16 +02:00

Merge branch 'main' into user-account

This commit is contained in:
binwiederhier 2022-12-23 09:37:47 -05:00
commit 7a507505aa
8 changed files with 1038 additions and 782 deletions
server

View file

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