diff --git a/webapp/titanembeds/utils.py b/webapp/titanembeds/utils.py index 0f4ab74..d9b5f38 100644 --- a/webapp/titanembeds/utils.py +++ b/webapp/titanembeds/utils.py @@ -20,7 +20,10 @@ from titanembeds.discordrest import DiscordREST discord_api = DiscordREST(config['bot-token']) def get_client_ipaddr(): - ip = request.remote_addr + if request.headers.getlist("X-Forwarded-For"): + ip = request.headers.getlist("X-Forwarded-For")[0] + else: + ip = request.remote_addr return hashlib.sha512((config['app-secret'] + ip).encode('utf-8')).hexdigest()[:15] def generate_session_key():