summaryrefslogtreecommitdiff
path: root/standalone.py
diff options
context:
space:
mode:
authormartin.von.loewis <devnull@localhost>2011-08-17 16:10:06 +0000
committermartin.von.loewis <devnull@localhost>2011-08-17 16:10:06 +0000
commit00ce0a1b64a0641e9af233b2da8c9dd234e2d215 (patch)
treeea06fbc6853cd3524a324238f8ef7c8cc5f9a514 /standalone.py
parentf869d94a1e73b50468ad0c032e1a2fd20b5efd4b (diff)
downloaddecorator-00ce0a1b64a0641e9af233b2da8c9dd234e2d215.tar.gz
Make standalone server redirect / to /pypi
Diffstat (limited to 'standalone.py')
-rwxr-xr-xstandalone.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/standalone.py b/standalone.py
index 209db60..3dee79e 100755
--- a/standalone.py
+++ b/standalone.py
@@ -9,6 +9,10 @@ class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
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):]