[PATCH] hgweb: show 404 on missing template in current style (issue3809)
Kevin Bullock
kbullock+mercurial at ringworld.org
Wed Feb 6 16:56:46 UTC 2013
On Feb 6, 2013, at 2:37 AM, Pierre-Yves David wrote:
> On Tue, Feb 05, 2013 at 11:43:04AM -0600, Kevin Bullock wrote:
>> # HG changeset patch
>> # User Kevin Bullock <kbullock at ringworld.org>
>> # Date 1360084904 21600
>> # Branch stable
>> # Node ID be8cfc33342e8277b7569f3b1f4f512ca798271a
>> # Parent 5d02f1d86c2e172d82eba98bc3248f3101c91bc4
>> hgweb: show 404 on missing template in current style (issue3809)
>>
>> diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py
>> --- a/mercurial/hgweb/hgweb_mod.py
>> +++ b/mercurial/hgweb/hgweb_mod.py
>> @@ -219,7 +219,11 @@ class hgweb(object):
>> tmpl = self.templater(req)
>> ctype = tmpl('mimetype', encoding=encoding.encoding)
>> ctype = templater.stringify(ctype)
>> + except error.Abort, err:
>> + req.respond(HTTP_NOT_FOUND, ctype)
>> + return tmpl('error', error=str(err))
>
> 404 on Abort exception seems far too wide. But I did not looked the code closely.
I was worried about that too, but I have a hard time picturing what else might be calling until.Abort in the templater. But then, I don't know that chunk very deeply.
pacem in terris / мир / शान्ति / سَلاَم / 平和
Kevin R. Bullock
More information about the Mercurial-devel
mailing list