Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webcommands.py @ 40248:b24c23f7c1f9
webcommands: use stringutil.pprint() to repr invalid archive types
Differential Revision: https://phab.mercurial-scm.org/D5074
author | Augie Fackler <augie@google.com> |
---|---|
date | Sat, 13 Oct 2018 07:53:51 -0400 |
parents | d216ae4cc3f6 |
children | 9c6473d2038b |
comparison
equal
deleted
inserted
replaced
40247:844deb408a5b | 40248:b24c23f7c1f9 |
---|---|
1170 type_ = web.req.qsparams.get('type') | 1170 type_ = web.req.qsparams.get('type') |
1171 allowed = web.configlist("web", "allow-archive") | 1171 allowed = web.configlist("web", "allow-archive") |
1172 key = web.req.qsparams['node'] | 1172 key = web.req.qsparams['node'] |
1173 | 1173 |
1174 if type_ not in webutil.archivespecs: | 1174 if type_ not in webutil.archivespecs: |
1175 msg = 'Unsupported archive type: %s' % type_ | 1175 msg = 'Unsupported archive type: %s' % stringutil.pprint(type_) |
1176 raise ErrorResponse(HTTP_NOT_FOUND, msg) | 1176 raise ErrorResponse(HTTP_NOT_FOUND, msg) |
1177 | 1177 |
1178 if not ((type_ in allowed or | 1178 if not ((type_ in allowed or |
1179 web.configbool("web", "allow" + type_))): | 1179 web.configbool("web", "allow" + type_))): |
1180 msg = 'Archive type not allowed: %s' % type_ | 1180 msg = 'Archive type not allowed: %s' % type_ |