mirror of
				https://github.com/TitanEmbeds/Titan.git
				synced 2025-11-04 07:47:10 +01:00 
			
		
		
		
	Add x forward for header
This commit is contained in:
		@@ -20,7 +20,10 @@ from titanembeds.discordrest import DiscordREST
 | 
				
			|||||||
discord_api = DiscordREST(config['bot-token'])
 | 
					discord_api = DiscordREST(config['bot-token'])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def get_client_ipaddr():
 | 
					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]
 | 
					    return hashlib.sha512((config['app-secret'] + ip).encode('utf-8')).hexdigest()[:15]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def generate_session_key():
 | 
					def generate_session_key():
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user