##// END OF EJS Templates
use untrusted settings in hgwebdir
Alexis S. L. Carvalho -
r3556:c3043ebe default
parent child Browse files
Show More
@@ -87,9 +87,10 b' class hgwebdir(object):'
87 "url": url})
87 "url": url})
88
88
89 def archivelist(ui, nodeid, url):
89 def archivelist(ui, nodeid, url):
90 allowed = ui.configlist("web", "allow_archive")
90 allowed = ui.configlist("web", "allow_archive", untrusted=True)
91 for i in [('zip', '.zip'), ('gz', '.tar.gz'), ('bz2', '.tar.bz2')]:
91 for i in [('zip', '.zip'), ('gz', '.tar.gz'), ('bz2', '.tar.bz2')]:
92 if i[0] in allowed or ui.configbool("web", "allow" + i[0]):
92 if i[0] in allowed or ui.configbool("web", "allow" + i[0],
93 untrusted=True):
93 yield {"type" : i[0], "extension": i[1],
94 yield {"type" : i[0], "extension": i[1],
94 "node": nodeid, "url": url}
95 "node": nodeid, "url": url}
95
96
@@ -114,7 +115,8 b' class hgwebdir(object):'
114 u.readconfig(os.path.join(path, '.hg', 'hgrc'))
115 u.readconfig(os.path.join(path, '.hg', 'hgrc'))
115 except IOError:
116 except IOError:
116 pass
117 pass
117 get = u.config
118 def get(section, name, default=None):
119 return u.config(section, name, default, untrusted=True)
118
120
119 url = ('/'.join([req.env["REQUEST_URI"].split('?')[0], name])
121 url = ('/'.join([req.env["REQUEST_URI"].split('?')[0], name])
120 .replace("//", "/")) + '/'
122 .replace("//", "/")) + '/'
General Comments 0
You need to be logged in to leave comments. Login now