aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar neptune 2023-07-23 00:45:03 -0400
committerLibravatar neptune 2023-07-23 00:45:03 -0400
commit929389cf6397211cc7359be7f0408804f97717c6 (patch)
tree7303dcd5ef153f4ae7da1651d3d68dc4e657c906
parent4c1f40d827e1d31049a916f8d29df992ed628853 (diff)
downloadweabot-929389cf6397211cc7359be7f0408804f97717c6.tar.gz
weabot-929389cf6397211cc7359be7f0408804f97717c6.tar.xz
weabot-929389cf6397211cc7359be7f0408804f97717c6.zip
Usar IP correcto entregado por el webserver
-rwxr-xr-xcgi/weabot.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cgi/weabot.py b/cgi/weabot.py
index 2efee41..86c86fe 100755
--- a/cgi/weabot.py
+++ b/cgi/weabot.py
@@ -38,7 +38,7 @@ class weabot(object):
logging.basicConfig(filename='weabot.log', format='%(asctime)s %(levelname)s %(message)s', level=Settings.LOG_LEVEL)
self.environ = environ
- self.ip = self.environ["HTTP_X_REAL_IP"]
+ self.ip = self.environ.get("HTTP_X_REAL_IP", self.environ.get("REMOTE_ADDR"))
if self.environ["PATH_INFO"].startswith("/weabot.py/"):
self.environ["PATH_INFO"] = self.environ["PATH_INFO"][11:]