Dolda2000 GitWeb
/
wrw.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Made appropriate Python3 changes.
[wrw.git]
/
wrw
/
dispatch.py
diff --git
a/wrw/dispatch.py
b/wrw/dispatch.py
index
e51559e
..
10cc2f6
100644
(file)
--- a/
wrw/dispatch.py
+++ b/
wrw/dispatch.py
@@
-1,5
+1,5
@@
import sys, traceback
import sys, traceback
-from . import env
+from . import env
, req, proto
__all__ = ["restart"]
__all__ = ["restart"]
@@
-73,3
+73,9
@@
def handle(req, startreq, handler):
return resp
finally:
req.cleanup()
return resp
finally:
req.cleanup()
+
+def handleenv(env, startreq, handler):
+ if not "HTTP_HOST" in env:
+ return proto.simpleerror(env, startreq, 400, "Bad Request", "Request must include Host header.")
+ r = req.origrequest(env)
+ return handle(r, startreq, handler)