[Pypi-checkins] r940 - trunk/pypi

martin.von.loewis python-checkins at python.org
Wed Aug 17 18:10:06 CEST 2011


Author: martin.von.loewis
Date: Wed Aug 17 18:10:06 2011
New Revision: 940

Modified:
   trunk/pypi/standalone.py
Log:
Make standalone server redirect / to /pypi


Modified: trunk/pypi/standalone.py
==============================================================================
--- trunk/pypi/standalone.py	(original)
+++ trunk/pypi/standalone.py	Wed Aug 17 18:10:06 2011
@@ -9,6 +9,10 @@
         self.send_header('Content-Type', content_type)
 
     def run(self):
+        if self.path == '/':
+            self.send_response(301)
+            self.send_header('Location', '/pypi')
+            return
         for scriptname in ('/mirrors', '/simple', '/pypi', '/serversig', '/daytime'):
             if self.path.startswith(scriptname):
                 rest = self.path[len(scriptname):]


More information about the Pypi-checkins mailing list