Fri Jun 22 09:30:21 UTC 2007 Peter Colberg <peterco@gmx.net>
* Adjust URI scheme according to CGI environment variable HTTPS.
This patch fixes RSS feed links when browsing darcsweb via SSL.
diff -rN -u old-darcsweb/darcsweb.cgi new-darcsweb/darcsweb.cgi
--- old-darcsweb/darcsweb.cgi 2013-07-18 20:19:08.000000000 +0000
+++ new-darcsweb/darcsweb.cgi 2013-07-18 20:19:08.000000000 +0000
@@ -2322,11 +2322,12 @@
n = os.environ['SERVER_NAME']
p = os.environ['SERVER_PORT']
s = os.path.dirname(os.environ['SCRIPT_NAME'])
- if p == '80':
+ u = os.environ.get('HTTPS', 'off') in ('on', '1')
+ if not u and p == '80' or u and p == '443':
p = ''
else:
p = ':' + p
- config.myurl = 'http://%s%s%s' % (n, p, s)
+ config.myurl = 'http%s://%s%s%s' % (u and 's' or '', n, p, s)
else:
config.myurl = base.myurl