2016-05-31 20:49:30 +00:00
|
|
|
from objects import glob
|
|
|
|
|
2016-08-17 14:41:05 +00:00
|
|
|
def getRequestIP(bottleRequest):
|
|
|
|
realIP = bottleRequest.headers.get("X-Forwarded-For") if glob.cloudflare == True else bottleRequest.headers.get("X-Real-IP")
|
|
|
|
if realIP != None:
|
|
|
|
return realIP
|
|
|
|
return bottleRequest.environ.get("REMOTE_ADDR")
|