##// END OF EJS Templates
Make {urlbase} work in templates when https is used.
Wesley J. Landaker -
r4867:8be7ba42 default
parent child Browse files
Show More
@@ -787,9 +787,16 b' class hgweb(object):'
787 style = req.form['style'][0]
787 style = req.form['style'][0]
788 mapfile = style_map(self.templatepath, style)
788 mapfile = style_map(self.templatepath, style)
789
789
790 if req.env.get('HTTPS'):
791 proto = 'https'
792 default_port = "443"
793 else:
794 proto = 'http'
795 default_port = "80"
796
790 port = req.env["SERVER_PORT"]
797 port = req.env["SERVER_PORT"]
791 port = port != "80" and (":" + port) or ""
798 port = port != default_port and (":" + port) or ""
792 urlbase = 'http://%s%s' % (req.env['SERVER_NAME'], port)
799 urlbase = '%s://%s%s' % (proto, req.env['SERVER_NAME'], port)
793 staticurl = self.config("web", "staticurl") or req.url + 'static/'
800 staticurl = self.config("web", "staticurl") or req.url + 'static/'
794 if not staticurl.endswith('/'):
801 if not staticurl.endswith('/'):
795 staticurl += '/'
802 staticurl += '/'
General Comments 0
You need to be logged in to leave comments. Login now