Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2053aa6

Browse files
committed
Use SCRIPT_NAME (if defined) instead of hardcoding /cgi-bin/ when
sending the cookie. (Suggestion by AMK.)
1 parent a74d0e4 commit 2053aa6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Tools/faqwiz/faqwiz.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ def send_my_cookie(ui):
150150
value = urllib.quote(value)
151151
then = now + COOKIE_LIFETIME
152152
gmt = time.gmtime(then)
153-
print "Set-Cookie: %s=%s; path=/cgi-bin/;" % (name, value),
153+
path = os.environ.get('SCRIPT_NAME', '/cgi-bin/')
154+
print "Set-Cookie: %s=%s; path=%s;" % (name, value, path),
154155
print time.strftime("expires=%a, %d-%b-%y %X GMT", gmt)
155156

156157
class MagicDict:

0 commit comments

Comments
 (0)