forward can be multiple ips, take first
This commit is contained in:
parent
7c6757f417
commit
3ef93908b6
1 changed files with 1 additions and 1 deletions
|
@ -107,7 +107,7 @@ class SessionData(models.Model):
|
||||||
if request.user.is_authenticated():
|
if request.user.is_authenticated():
|
||||||
data.user = request.user
|
data.user = request.user
|
||||||
if 'HTTP_X_FORWARDED_FOR' in request.META:
|
if 'HTTP_X_FORWARDED_FOR' in request.META:
|
||||||
data.ip = request.META['HTTP_X_FORWARDED_FOR']
|
data.ip = request.META['HTTP_X_FORWARDED_FOR'].split(',')[0]
|
||||||
else:
|
else:
|
||||||
data.ip = request.META['REMOTE_ADDR']
|
data.ip = request.META['REMOTE_ADDR']
|
||||||
if data.ip.startswith('::ffff:'):
|
if data.ip.startswith('::ffff:'):
|
||||||
|
|
Loading…
Reference in a new issue