summaryrefslogtreecommitdiffstats
path: root/Tools/faqwiz
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-09-04 21:19:55 (GMT)
committerGuido van Rossum <guido@python.org>1998-09-04 21:19:55 (GMT)
commit2053aa6cc05a3aa581db083138b0ed94f60ec920 (patch)
treeec50b69a2a5dc1c8bd276bd4c964f611221ed349 /Tools/faqwiz
parenta74d0e4c55ded033de0bf14bb4c6c56bfff5f5ac (diff)
downloadcpython-2053aa6cc05a3aa581db083138b0ed94f60ec920.zip
cpython-2053aa6cc05a3aa581db083138b0ed94f60ec920.tar.gz
cpython-2053aa6cc05a3aa581db083138b0ed94f60ec920.tar.bz2
Use SCRIPT_NAME (if defined) instead of hardcoding /cgi-bin/ when
sending the cookie. (Suggestion by AMK.)
Diffstat (limited to 'Tools/faqwiz')
-rw-r--r--Tools/faqwiz/faqwiz.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Tools/faqwiz/faqwiz.py b/Tools/faqwiz/faqwiz.py
index 618b62d..2add159 100644
--- a/Tools/faqwiz/faqwiz.py
+++ b/Tools/faqwiz/faqwiz.py
@@ -150,7 +150,8 @@ def send_my_cookie(ui):
value = urllib.quote(value)
then = now + COOKIE_LIFETIME
gmt = time.gmtime(then)
- print "Set-Cookie: %s=%s; path=/cgi-bin/;" % (name, value),
+ path = os.environ.get('SCRIPT_NAME', '/cgi-bin/')
+ print "Set-Cookie: %s=%s; path=%s;" % (name, value, path),
print time.strftime("expires=%a, %d-%b-%y %X GMT", gmt)
class MagicDict: