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

Store client IP address in request context

This commit is contained in:
Frédéric Guillot 2018-09-09 15:15:14 -07:00
parent c1e1506720
commit c9f9dd3262
9 changed files with 46 additions and 19 deletions

View file

@ -100,8 +100,8 @@ func HasQueryParam(r *http.Request, param string) bool {
return ok
}
// RealIP returns client's real IP address.
func RealIP(r *http.Request) string {
// FindClientIP returns client's real IP address.
func FindClientIP(r *http.Request) string {
headers := []string{"X-Forwarded-For", "X-Real-Ip"}
for _, header := range headers {
value := r.Header.Get(header)