Skip to content

Commit

Permalink
Fix in get_client_ip
Browse files Browse the repository at this point in the history
  • Loading branch information
shakedown-street committed Jun 19, 2024
1 parent d8fced3 commit a38757f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions punkweb_insight/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ def get_client_ip(self, request):
)

for header in headers:
ip = request.META.get(header, None)
if ip:
if request.META.get(header, None):
ip = request.META[header].split(",")[0].strip()
try:
validate_ipv46_address(ip)
return ip
Expand Down

0 comments on commit a38757f

Please sign in to comment.