X-Git-Url: http://dolda2000.com/gitweb/?p=wrw.git;a=blobdiff_plain;f=wrw%2Fproto.py;h=80e24197843c4b71f2ea04c7de826998a169eab2;hp=628bfc9fb5d22adaaa7914ffe254247ae47d32c2;hb=51a13716668cc48bf87e0d0296f8b9900fafe83b;hpb=6a9037cbbdde6ac644683096f8b0b0e53a678b3e diff --git a/wrw/proto.py b/wrw/proto.py index 628bfc9..80e2419 100644 --- a/wrw/proto.py +++ b/wrw/proto.py @@ -168,11 +168,16 @@ def scripturl(req): raise Exception("Malformed local part when reconstructing URL") return siteurl(req) + req.uriname[1:] -def requrl(req): +def requrl(req, qs=True): s = siteurl(req) if req.uri[0] != '/': raise Exception("Malformed local part when reconstructing URL") - return siteurl(req) + req.uri[1:] + pf = req.uri[1:] + if not qs: + p = pf.find('?') + if not p < 0: + pf = pf[:p] + return siteurl(req) + pf def parstring(pars={}, **augment): buf = ""