KeyError with non-existent repositories (hgwebdir.cgi)

Matt Mackall mpm at selenic.com
Sat Jul 14 14:44:09 CDT 2007


On Sat, Jul 14, 2007 at 03:27:30PM -0400, Maxim Khitrov wrote:
> Hello,
> 
> I'm trying to configure hgwebdir.cgi script to serve a few of my
> repositories via Lighttpd. I'm using rewrite rules to send all
> requests to the cgi script, and the whole thing works great for the
> repositories that are there.
> 
> My question is about requests for non-existent directories. If I try
> to access some random path that does not point to a valid repository,
> I get a KeyError message with a ton of output containing the call
> trace. My problem with this is that it exposes all the relevant paths
> on the server. Where hgwebdir.cgi is running from, where python is
> installed, and so on. I'm curious to know if there is some way to
> suppress this output? For example, just send a 404 error instead.
> 
> If nothing like that exists right now, perhaps it is something worth
> adding as a configuration option to hgweb.config?

Comment out cgitb.enable() in your hgwebdir.cgi script.

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial mailing list