Fix for PyAnyw IP?

This commit is contained in:
Jeremy Zhang 2017-04-07 17:24:56 -07:00
parent e78117e379
commit e9aa929c3b

View File

@ -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