summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergiusz Bazański <q3k@q3k.org>2013-02-20 11:20:07 +0100
committerSergiusz Bazański <q3k@q3k.org>2013-02-20 11:20:07 +0100
commitaf052783b1fe4c51bb5b120512a3b7fd5260f83a (patch)
tree75de6076ee68733fbe8eaa72c4e0a966b2068d77
parent7e0f2edcede8fb67e835359c43edd5934c08f300 (diff)
downloadwww-main-af052783b1fe4c51bb5b120512a3b7fd5260f83a.tar.gz
www-main-af052783b1fe4c51bb5b120512a3b7fd5260f83a.tar.bz2
www-main-af052783b1fe4c51bb5b120512a3b7fd5260f83a.tar.xz
www-main-af052783b1fe4c51bb5b120512a3b7fd5260f83a.zip
Signal mailman remote IP via X-Forwarded-For.
-rw-r--r--main.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.py b/main.py
index 497d5c3..667a97c 100644
--- a/main.py
+++ b/main.py
@@ -25,7 +25,9 @@ def pull_feed_entries():
def mailman_subscribe(email, mailing_list):
password = "".join(random.choice(string.letters) for _ in range(8))
- r = requests.post("https://lists.hackerspace.pl/subscribe/" + mailing_list, {"email": email, "fullname": "", "pw": password, "pw-conf": password, "email-button": "Zapisz", "digest": 0})
+ post = {"email": email, "fullname": "", "pw": password, "pw-conf": password, "email-button": "Zapisz", "digest": 0}
+ headers = {"X-Forwarded-For": request.remote_addr}
+ r = requests.post("https://lists.hackerspace.pl/subscribe/" + mailing_list, post, headers=headers)
if r.status_code != 200:
return False
return True