[Python-Dev] hgweb misconfiguration

Michael Foord michael at voidspace.org.uk
Wed Jan 2 12:54:21 CET 2013


Hey folks,

Likely the wrong place to report this, but I couldn't work out the best place and figured this is only as bad as anywhere else.

A user has reported to webmaster that hgweb is misconfigured (or at least the server configuration is interfering with hgweb).

The symptom is that this url is incorrectly a 404:

	http://hg.python.org/cpython/file/3.3/Doc/tools/sphinxext/static/version_switch.js

His diagnosis:

>> the web server is misconfigured to serve the hgweb static
>> files for any directory named 'static'. It is appropriate for it to do
>> this for http://hg.python.org/static/ and maybe even
>> http://hg.python.org/cpython/static/ and the other repositories, but
>> it is inappropriate for it to serve the hgweb static files within the
>> repository contents.



What should have happened: The web server passes on the request to
hgweb, which notices that it is supposed to retrieve a particular
version of a file from the Mercurial repository and show it to the
user. This works successfully for URLs not containing '/static/'
(ending slash significant), e.g.,
<http://hg.python.org/cpython/file/3.3/Doc/tools/sphinxext/static>.
You can see that hgweb successfully displays the directory listing.

However, try adding a slash onto the end of that. The web server picks
up '/static/' and takes over the request, listing its static files
(rather than letting hgweb display the 'static' directory from the
Mercurial repository). The static files shown by the web server's
directory listing are used for the user interface of hgweb; for
example, the logo <http://hg.python.org/cpython/static/hglogo.png>. It
should be serving those static files on <http://hg.python.org/static/>
and <http://hg.python.org/repo/static/> (where repo is a repository
name like cpython), but it is also serving on
<http://hg.python.org/repo/file/.../static/>, which is inappropriate,
because it makes it impossible to view version_switch.js and the other
files in that directory with the hgweb interface.

--
http://www.voidspace.org.uk/


May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing 
http://www.sqlite.org/different.html







More information about the Python-Dev mailing list