diff options
author | martin.von.loewis <devnull@localhost> | 2011-08-17 16:10:06 +0000 |
---|---|---|
committer | martin.von.loewis <devnull@localhost> | 2011-08-17 16:10:06 +0000 |
commit | 00ce0a1b64a0641e9af233b2da8c9dd234e2d215 (patch) | |
tree | ea06fbc6853cd3524a324238f8ef7c8cc5f9a514 /standalone.py | |
parent | f869d94a1e73b50468ad0c032e1a2fd20b5efd4b (diff) | |
download | decorator-00ce0a1b64a0641e9af233b2da8c9dd234e2d215.tar.gz |
Make standalone server redirect / to /pypi
Diffstat (limited to 'standalone.py')
-rwxr-xr-x | standalone.py | 4 |
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):] |