Dolda2000 GitWeb
/
wrw.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6a9037c
)
Added option to strip querystring from requrl.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Wed, 21 Mar 2018 16:14:59 +0000
(17:14 +0100)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Wed, 21 Mar 2018 16:14:59 +0000
(17:14 +0100)
wrw/proto.py
patch
|
blob
|
blame
|
history
diff --git
a/wrw/proto.py
b/wrw/proto.py
index
628bfc9
..
80e2419
100644
(file)
--- 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 = ""