diff redirectall/dispatcher.py @ 1:3117c5556eca default tip

update redirectall
author Jeff Hammel <jhammel@mozilla.com>
date Sun, 08 May 2011 19:14:21 -0700
parents 9e2187433034
children
line wrap: on
line diff
--- a/redirectall/dispatcher.py	Sun May 08 18:28:26 2011 -0700
+++ b/redirectall/dispatcher.py	Sun May 08 19:14:21 2011 -0700
@@ -2,10 +2,9 @@
 request dispatcher
 """
 
-from handlers import Get, Post
 from webob import Request, exc
 
-class Dispatcher(object):
+class RedirectAll(object):
 
     ### class level variables
 
@@ -15,5 +14,8 @@
     ### methods dealing with HTTP
     def __call__(self, environ, start_response):
         request = Request(environ)
-        import pdb; pdb.set_trace()
-        return res(environ, start_response)
+        location = self.base_url + request.path
+        if request.query_string:
+            location += '?' + request.query_string
+        response = exc.HTTPMovedPermanently(location=location)
+        return response(environ, start_response)