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:
parent
c1e1506720
commit
c9f9dd3262
9 changed files with 46 additions and 19 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue