emile 10 months ago
parent 45f9e24752
commit 497faf45a1

Binary file not shown.

@ -10,7 +10,8 @@ import requests
class OsitcomVisitor(WebsocketConsumer):
def connect(self):
self.accept()
ip_address = self.scope.get('headers', {}).get('x-forwarded-for', None)
headers = dict(self.scope.get('headers', []))
ip_address = headers.get(b'x-forwarded-for', None)
if ip_address:
# Extract the actual IP address if there are multiple addresses
self.visitor_ip = ip_address.split(',')[0].strip()

Loading…
Cancel
Save