Skip to content

Commit aca4526

Browse files
author
Inbal Tako
committed
Fix ip extraction
1 parent 8234ba2 commit aca4526

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.8
1+
0.2.9

securenative/utils/request_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def get_client_ip_from_request(request):
1919
ip = request.META.get('REMOTE_ADDR')
2020
return ip
2121
except Exception:
22-
return ""
22+
return request.environ.get('HTTP_X_FORWARDED_FOR', request.environ.get('REMOTE_ADDR', ""))
2323

2424
@staticmethod
2525
def get_remote_ip_from_request(request):

securenative/utils/version_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ class VersionUtils(object):
22

33
@staticmethod
44
def get_version():
5-
return "0.2.8"
5+
return "0.2.9"

0 commit comments

Comments
 (0)