From e9aa929c3b7a656ec98189706e78e301ba102597 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Fri, 7 Apr 2017 17:24:56 -0700 Subject: [PATCH] Fix for PyAnyw IP? --- titanembeds/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/titanembeds/utils.py b/titanembeds/utils.py index 3e86e6b..5de8fcd 100644 --- a/titanembeds/utils.py +++ b/titanembeds/utils.py @@ -11,7 +11,7 @@ discord_api = DiscordREST(config['bot-token']) cache = Cache() def get_client_ipaddr(): - if hasattr(request.headers, "X-Real-IP"): # pythonanywhere specific + if "X-Real-IP" in request.headers: # pythonanywhere specific return request.headers['X-Real-IP'] else: # general return request.remote_addr