1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-15 18:57:04 +00:00

Make sure the remote address is populated even when using unix socket

This commit is contained in:
Frédéric Guillot 2018-11-11 16:42:30 -08:00
parent 1315282c7f
commit 9f85f67031
2 changed files with 25 additions and 0 deletions

View file

@ -34,5 +34,10 @@ func FindClientIP(r *http.Request) string {
remoteIP = r.RemoteAddr
}
// When listening on a Unix socket, RemoteAddr is empty.
if remoteIP == "" {
remoteIP = "127.0.0.1"
}
return remoteIP
}