Allow funplex to handle requests to root.
authorFredrik Tolf <fredrik@dolda2000.com>
Thu, 1 Feb 2018 03:50:54 +0000 (04:50 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Thu, 1 Feb 2018 03:50:54 +0000 (04:50 +0100)
wrw/util.py

index a1dcc6c..7209ae4 100644 (file)
@@ -41,6 +41,8 @@ class funplex(object):
 
     def __call__(self, req):
         if req.pathinfo == "":
 
     def __call__(self, req):
         if req.pathinfo == "":
+            if "__root__" in self.dir:
+                return self.dir["__root__"](req)
             raise resp.redirect(req.uriname + "/")
         if req.pathinfo[:1] != "/":
             raise resp.notfound()
             raise resp.redirect(req.uriname + "/")
         if req.pathinfo[:1] != "/":
             raise resp.notfound()