X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=wrw%2Futil.py;h=92b441c08ddb5fb47227f963da8f205eb9c2c7f0;hb=2b4cce75e1eb09715b27fa94b63484c0a6f5a032;hp=4fad6e90db35d93356830df483c87da20f2d9036;hpb=f639ac812fc618d4b45d419dc0a415a2e53ddf6e;p=wrw.git diff --git a/wrw/util.py b/wrw/util.py index 4fad6e9..92b441c 100644 --- a/wrw/util.py +++ b/wrw/util.py @@ -49,7 +49,9 @@ class funplex(object): p = p.partition("/")[0] bi = len(p) + 1 if p in self.dir: - return self.dir[p](req.shift(bi)) + sreq = req.shift(bi) + sreq.selfpath = req.pathinfo[1:] + return self.dir[p](sreq) raise resp.notfound() def add(self, fun): @@ -62,7 +64,7 @@ class funplex(object): return fun return dec -def persession(data = None): +def persession(data=None): def dec(callable): def wrapper(req): sess = session.get(req) @@ -112,7 +114,7 @@ def pregen(callable): class sessiondata(object): @classmethod - def get(cls, req, create = True): + def get(cls, req, create=True): sess = cls.sessdb().get(req) with sess.lock: try: @@ -258,6 +260,6 @@ class specdirty(sessiondata): def datecheck(req, mtime): if "If-Modified-Since" in req.ihead: rtime = proto.phttpdate(req.ihead["If-Modified-Since"]) - if rtime >= math.floor(mtime): + if rtime is not None and rtime >= math.floor(mtime): raise resp.unmodified() req.ohead["Last-Modified"] = proto.httpdate(mtime)