aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Cgi/listinfo.py
diff options
context:
space:
mode:
authorJim Popovitch <jimpop@gmail.com>2015-06-23 13:40:09 +0000
committerJim Popovitch <jimpop@gmail.com>2015-06-23 13:40:09 +0000
commit28f5f0ce0be5529598124bbe5e0d72b0fd605e69 (patch)
tree50ba7d691efa59a0c45d740993c20c392bf4f94b /Mailman/Cgi/listinfo.py
parentab19a1505dd93eca5d9ca6792740c9eb56302cfe (diff)
downloadmailman2-28f5f0ce0be5529598124bbe5e0d72b0fd605e69.tar.gz
mailman2-28f5f0ce0be5529598124bbe5e0d72b0fd605e69.tar.xz
mailman2-28f5f0ce0be5529598124bbe5e0d72b0fd605e69.zip
Support for HTTP_X_FORWARDED_FOR and HTTP_FORWARDED_FOR (RFC 7239)
Diffstat (limited to '')
-rw-r--r--Mailman/Cgi/listinfo.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Mailman/Cgi/listinfo.py b/Mailman/Cgi/listinfo.py
index 3c04e8a7..4de5ccea 100644
--- a/Mailman/Cgi/listinfo.py
+++ b/Mailman/Cgi/listinfo.py
@@ -187,9 +187,10 @@ def list_listinfo(mlist, lang):
'subscribe')
if mm_cfg.SUBSCRIBE_FORM_SECRET:
now = str(int(time.time()))
- remote = os.environ.get('REMOTE_HOST',
- os.environ.get('REMOTE_ADDR',
- 'w.x.y.z'))
+ remote = os.environ.get('HTTP_FORWARDED_FOR',
+ os.environ.get('HTTP_X_FORWARDED_FOR',
+ os.environ.get('REMOTE_ADDR',
+ 'w.x.y.z'))
# Try to accept a range in case of load balancers, etc. (LP: #1447445)
if remote.find('.') >= 0:
# ipv4 - drop last octet