5
5
# this is not intended to be an all-knowing IP address regex
6
6
IP_RE = re.compile('\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}')
11
13
behind a proxy, they may have a comma-separated list of IP addresses, so
12
14
we need to account for that. In such a case, only the first IP in the
13
15
list will be retrieved. Also, some hosts that use a proxy will put the
14
16
REMOTE_ADDR into HTTP_X_FORWARDED_FOR. This will handle pulling back the
15
17
IP from the proper place.
18
21
# if neither header contain a value, just use local loopback