# HG changeset patch # User Jeff Hammel # Date 1330716949 28800 # Node ID b2ea14bf9f46cee44fcfb70ca90eb0bcbc8aa9bb # Parent dcb98ad8463e5a30e3aa9cc3456cd494e79794a2 add a slash to the namespaced directory diff -r dcb98ad8463e -r b2ea14bf9f46 simpypi/factory.py --- a/simpypi/factory.py Fri Mar 02 11:29:57 2012 -0800 +++ b/simpypi/factory.py Fri Mar 02 11:35:49 2012 -0800 @@ -11,6 +11,7 @@ import tempfile from fileserver import DirectoryServer +from webob import exc from wsgi import SimPyPI from wsgiref import simple_server @@ -24,6 +25,8 @@ def __call__(self, environ, start_response): path = environ['PATH_INFO'] if path == self.namespace: + response = exc.HTTPMovedPermanently(add_slash=True) + return response(environ, start_response) environ['PATH_INFO'] = '/' return DirectoryServer.__call__(self, environ, start_response) elif path.startswith(self.namespace + '/'):